Is there a software interface for retrieving / exporting Salesforce report results?

I am trying to get the results of a Salesforce report programmatically.

This blog is often mentioned about how to clear results from a web page, but the method is not supported: http://sfdc-heretic.warped-minds.com/2006/04/10/progmatic-access-to-salesforcecom-reports/ .

I can get the list of reports via REST api:

require 'restforce' restforce_client = Restforce.new( :refresh_token => <refresh token>, :client_id => <client id>, :client_secret => <client secret> ) reports = restforce.query("SELECT Id,DeveloperName FROM Report") reports.last.DeveloperName => "Rob_Test_Report" 

I also tried searching through the ReportAldor API SOAP API metadata object:

 require 'metaforce' metaforce = Metaforce.new( :username => <username>, :password => <password>, :security_token => <security token> ) report_folders = metaforce.list_metadata('ReportFolder') report_folders.last.full_name => "RobTestReportFolder" 

I see a folder. I haven’t received the content yet, but even when it seems to me that I’m just getting metadata around the report itself (i.e. Filter Criteria), not the report results. The api metadata is discussed here: https://success.salesforce.com/questiondetail?qId=a1X30000000IQ8pEAG . Is it correct?

I saw this similar question a couple of years ago, but I did not know if it was correct or something had changed in the API: How to access reports programmatically in SalesForce using Apex

Can I export or pull report results through a supported Salesforce API?

+4
source share
2 answers

You cannot get report results without using the Google Analytics API, which according to Summer '13 will only be available as a pilot. If you want to participate in the pilot, let me know and I will send your request.

Once in Pilot you use the REST endpoint passing in the report Id. You will have two endpoints: a description endpoint and a runreport pointer. What is returned from the Report description is a JSON representation of the metadata for the report (describes dimensions and facts, etc.) And from runReport it represents a JSON representation of the data.

Once you have the data, you can do what you want with it. Report data is only available at the summary level, and only summary and matrix reports are supported for reports.

+2
source

I do not know any software ways to do this. Conga application may be one of the options, but I believe that they get filters from the report metadata and build the corresponding SOQL query ...

The blog post you were talking about should work. You probably lost something like setting a session id in a cookie.

Hack, bug, use a web scraper to use something similar to the trick I did with Apex: https://salesforce.stackexchange.com/questions/4303/scheduled-reports-as-attachment . Theoretically, you would be able to remove a similar thing from any other API access as long as you have a user session identifier (regardless of whether it went from entering the session or was generated from the SOAP login ...)

You can also check the metadata for my question: https://salesforce.stackexchange.com/questions/4692/screen-scrape-salesforce-with-rest-get-call-from-apex

0
source

Source: https://habr.com/ru/post/1479357/


All Articles