Make it possible to use a query when exporting