0

I am just going through the async SOQL guide. I am finding it very useful as we often have large SOQL queries which runs over time limit.

But it seems to me that the result of the async SOQL can only be stored inside a target SObject, which sounds a bit weird. Is there a way we can make it export to a target .csv file or something instead of the the target sobject?

2
  • Why don't you just export the results from the SObject to a .csv? The SObject is just a map of the Async SOQL results, simular to what you would get in a .csv
    – Wim
    Nov 27, 2017 at 12:54
  • The only thing I am worried about is storage and API usage. @Wim
    – Lance Shi
    Nov 28, 2017 at 6:02

1 Answer 1

0

Unfortunately, it cannot be stored (directly) in another form than SObject. Salesforce does not support that. Submitting the request must be done by using an API. Please also keep in mind that this is an Async query. A CSV file would need to be stored somewhere in SF DB waiting for you to download it. It cannot be downloaded immediately as it would be synchronous.

If you want a CSV as a result, please create a custom SObject to reflect the data you need. Submit Async SOQL request. Wait for results and export created records. Then records can be deleted if you are aware of storage usage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .