How to GET records from Salesforce using Logic App: Using built-in Salesforce GET Records Connector
Part 1: How to get records from Salesforce in Logic App — Using built-in Salesforce GET Records Connector
Introduction:
Working with Salesforce connectors can be a bit tricky as you have to convert your SOQL into a set of built-in parameters provided by the Salesforce GET records connector. This blog will show you how you can easily handle this in two parts as follows:
Part 1: How to GET records from Salesforce using Logic App Salesforce GET Records Connector
Part 2: How to GET records from Salesforce using Salesforce SOQL in Logic App
Salesforce Built-In GET Records connector
Following a sample sequence of steps that can be used fetch the Accounts from salesforce and further its related records. This example also shows how you can use the different parameters provided by this built-in GET Records connector.
Step 1: Add the Get Records block of Salesforce and Select the Object type as Accounts. Add parameters as follows
Select Query to select specific fields
Filter to add a filter condition for records to be fetched. Note this query should be An ODATA filter query. Refer to this link for reference Using Filter Expressions in OData URIs — Dynamics NAV | Microsoft Docs
Top Count to specify the total records to be fetched. Here we have used a variable that has the int value of the Total number of records.
Skip Count to specify the number of entries to skip (default = 0). Here we have used expression mul(variables(‘total-records’),sub(variables(‘page-number’),1)) to handle Pagination.
For more information on Salesforce GET records connector of Salesforce refer to: Salesforce — Connectors | Microsoft Docs
Step 2: Add a For Each block and in Select an Output from previous steps add ‘value’ to loop over each account.
Step 3: Add the Get Records block of Salesforce and Select the Object types shown below. Add parameters for Select Query and Top Count and configure them as follows.
Conclusion:
Here we have learned how to use the Logic App Salesforce GET records connector and the parameters that it provides out of the box.