cancel
Showing results for 
Search instead for 
Did you mean: 

Salesforce Report Data into Snaplogic

anilv
New Contributor II

Hi all,
How to get Salesforce Report Data into Snaplogic,
example in salesforce we have one report,in that report we have 10 records,these records i need in snaplogic, how to get this records into snaplogic.

if any idea please help me on this,

Regards
Anil

8 REPLIES 8

eric_sou
New Contributor III

Hi all, I am also interested in the solution found!
Thanks,

Ajay_Chawda
Contributor

Hi All,
did any one found solution ?
Any help will be help.

Regards,
Ajay Chawda

@Ajay_Chawda @eric.sou @anilv

We are likely to add a new Report-related Snap to the Salesforce Snap Pack in the coming months but here are some brief notes on using the REST Snap Pack to access SFDC Report Data.

I would also be interested in your feedback - the API output looks rather tricky to deal with (the data and columns are decoupled) and I’d love to learn what feedback you have both to what report data you wish to access, how easy it is to use and any additional comments you may have.

I’m going to reference internal test environments here, so customers may need to adjust for their situation/tenant etc. I’ve also redacted some information that is sensitive.

  1. I leveraged an existing SFDC Force Connected App that we use for testing internally. A Connected App can be created by choosing Setup in Salesforce UI Home:

image

Then choose Apps > App Manager:

image

and create a New Connected App:

image

Provide a Connected App Name, and API Name, and a Contact Email (the values for the first two are your choice). Under “API (Enable OAuth Settings)”, enable the “Enable OAuth Settings” checkbox and provide the following under “Callback URLs”: https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest.

In terms of scopes to select, our test app has a large number of scopes selected but start with these are pair down to just what you need:

community-sfdc-reports_1-oauth-app

Leave all other settings untouched. After saving the App, View it to see the Consumer Key and Consumer Secret values you will use in the REST OAuth2 Account.

  1. I created a REST OAuth2 account, using the Key and Secret above for the “Client ID” and “Client secret” settings respectively. I’m using our SFDC domain in the OAuth2 Endpoint and Token URL fields:

community-sfdc-reports_2-account-config

https://<tenant>.my.salesforce.com/services/oauth2/authorize
https://<tenant>.my.salesforce.com/services/oauth2/token

Clicking the Authorize button, will allow the OAuth dance to begin and an access and refresh token to be acquired and saved to the account.

Salesforce doesn’t use refresh token expirations (hence the -1 above), but our Platform treats it as if it is an hour expiration.

  1. A REST GET Snap (with the account created above set) can now be used to attempt to list Reports:

community-sfdc-reports_3-rest-get

https://<tenant>.my.salesforce.com/services/data/v50.0/analytics/reports

note, I’m not adding any pagination handling here

This will return data that have relative URL references to different reports:

community-sfdc-reports_4-rest-output

Another REST GET Snap can then be used after a JSON Splitter to call each report:

community-sfdc-reports_5-rest-one-report

The output is very verbose:

community-sfdc-reports_6-rest-one-output

The factMap field appears to contain the row-by-row data, and the columns look like they are detailed under reportExtendedMetadata.detailColumnInfo

This will require some sophisticated use of SnapLogic Mappers, Splitters and expressions to convert to a key:value-type set of pairings:

community-sfdc-reports_7-rest-one-output2

That is where I stopped my investigation for - the pipeline .slp file is below and can be imported:

community-sfdc-reports_8-pipeline

salesforce-sfdc-rest-reports_2021_01_22.slp (7.3 KB)

The SFDC Reports API can be consulted further for specific API use cases: Salesforce Developers

Please do let me know any questions or comments you have.

sanjaynayak
New Contributor III

Hi All,

We are trying to call a trigger task from salesforce to snaplogic . We are using onpremises url for trigger task instead elastic one. Do we have any document how to configure fire wall for in bound call to snaplogic. It seems like salesforce has bunch of IP.
Any suggestion or any help would be helpful. Do we need to white list all ip/subdomain/domain config?