You need to sign in to do that
Don't have an account?
Alexandre Dinnouti
Saving SOQL results as json in AWS S3
Hi !
Is there a tool out there to save SOQL query results as JSON in AWS S3? We are planning to write a system to cache SOQL query results using SalesForce API, before start coding I would like to know if such solution already exists.
thanks,
Alex.
Is there a tool out there to save SOQL query results as JSON in AWS S3? We are planning to write a system to cache SOQL query results using SalesForce API, before start coding I would like to know if such solution already exists.
thanks,
Alex.
Kinldy refer the below URL:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_json_json.htm
Thanks
karthik
you can use standard JSON method serializepretty like below.
ˇserializePretty(objectToSerialize)
Serializes Apex objects into JSON content and generates indented content using the pretty-print format.
Lets say you got your SOQL result in the list accountList object. Pass this list as a parameter to serializePretty method like below.
List<Account> accountList = [SOQL QUERY];
String jsonResult = JSON.serializePretty(accountList);
Please give a thumbsup if this helps you.
Regards,
Zaja.