Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to automatise the exporting of Salesforce Reports as CSV's, so far I've managed to authenticate in the Salesforce API but I couldn't find any proper documentation on how to export the Salesforce Reports as CSV's or any other examples of doing it.

I've understood that there is a chance that could not be done, but you can still export it as a JSON and convert it to a CSV using a library, although I didn't find anything.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

If you're authenticated (got session id back) you're almost there.

The hacky, not officially supported way is to send a GET request to the report export just like user would click a button. Check out How to download a report as a CSV directly from Salesforce Lightning? or Salesforce: Download Reports via URL in R examples (it's not Java but same principle). You'd have to send header that sets cookie with sid=sesionidgoeshere.

The more official way would be to use the reporting API


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...