How to GET records from Salesforce using Logic App: How to get records from Salesforce in Logic App — Using SOQL

Rushank Karekar
2 min readJan 4, 2022

--

Part 2: How to get records from Salesforce in Logic App — Using SOQL

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

How to GET Records using SOQL in Logic App HTTP 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 an Azure Function block to get a salesforce access token. Here in the backend, the selected function sends the access token to authenticate with Salesforce on the execution of this block.

Step 2: Add an HTTP block and configure it as follows to run SOQL query. The URI is composed as follows https://test.my.salesforce.com/services/data/v49.0/query?q={{SOQL_Query}}. Here the SOQL which we append at the end of the URL must be in encoded format. You can use the https://meyerweb.com/eric/tools/dencoder/ online editor for this purpose where you can encode your SOQL and attach it at end of the URL.

In Headers add Authorization: Bearer {{Access_Token}}

Conclusion:

Here we have learned how to use the Logic App HTTP connector to retrieve the records from Salesforce using the SOQL.

--

--

Rushank Karekar

Working as a Software Engineer at CloudFronts in BI department with Hands-on experience on Azure Integration Services, Power BI, SSRS, SSIS and Scribe Online.