Integration with CRM and For Each
Below is an example of an integration flow with CRM and For Each.
Summary
In this example, we have a flow that runs every day at midnight. It synchronizes product information from ERP with CRM and BI, ensuring that all information is up-to-date and consistent across all systems. At the end, it sends a notification via Slack.
See the sequence of steps in the flow image below:
The flow is composed of the following steps:
-
Trigger: Scheduler Trigger
-
Connectors: SAP 4 Hana, SalesForce, and Slack
-
General tool: For Each
Authorizations
To begin, let’s register the authorizations that will be used:
-
API KEY
See below how to register the API Key authorization that we will use for the Slack connector:
-
OAUTH 2 - Client Credentials
See below how to register the OAUTH 2 - Client Credentials authorization that we will use for the SalesForce connector:
For more details on authorization types, read the documentation on Authorizations. |
Environment Variables
To create the environment variables that will be used in the flow, click on the environment variables icon in the left menu of the canvas.
See in the GIF how to register the environment variables:
For more information, read the documentation on Environment Variables. |
Steps
After that, let’s see in more detail how to configure an example of each type of step:
Trigger: Scheduler Trigger
This step will be responsible for initiating the execution of the integration flow, which will occur daily at midnight.
-
In the left menu, select Triggers and then select Scheduler Trigger.
-
Fill in the name of the trigger, which in the example will be "Every day at 12 am".
-
Insert the corresponding Cron Expression. In this case, the expression will be "* * * 0 0".
-
Click on Save.
See the steps in the GIF:
For more information, read the documentation on Scheduler Trigger. |
General Tool: For Each
After starting the flow and obtaining the product list in the previous step "Get Product List", the flow will perform certain actions for each product in the list. The actions performed for each product will be those inside For Each.
-
In the left menu, select General Tools and then select For Each.
-
Fill in the name of the tool, which will be "For Each Product" (once the actions are performed for each product).
-
In the Variable field, click on Properties and select "$.Get_Product_List.Response.Payload.value", which is the response from the previous step with the product list.
-
In the Iteration Element field, fill in the name of the element that will be repeated, which will be "Product List".
-
Enable the Ignore Errors button.
-
Click on SAVE.
See the steps in the GIF:
For more information, read the documentation on For Each. |
Connector: REST API
In this step of the flow, we have already retrieved the list of products and the description. Now, we will update the CRM product catalog.
Since we are using a REST API connector, we will configure its payload through the data mapping feature.
-
In the left menu, select Connectors and search for the SalesForce connector.
-
Fill in the connector’s name, which will be "Update CRM Catalog".
-
Select the "POST/Product" route.
-
Insert the URL.
-
Keep the Request Timeout field with the default value: 3000.
-
In the Security field, select "Authorization SalesForce".
-
Click on Create Data Mapping.
-
In the FROM column, select "$.Get_Description.Response.Payload.value.ProductDescription".
-
In the TO column, select "$.Request.Payload.Name".
-
Click on ADD MAPPING.
-
Click on CONFIRM.
-
Enable the Ignore Errors button.
-
Click on SAVE.
For more information about this type of connector, read the documentation on REST API connectors. |
End
After configuring all the steps of the flow, you should connect to the End step.
Test Mode
To execute your flow in test mode and check for any errors before deployment, click on TEST MODE.
Then, click EXECUTE.
You will be able to check the logs in Sensedia Analytics.
See the steps in the GIF below:
For more information, read the documentation on Test Mode. |
Deploy
To deploy your flow, click on DEPLOY.
Check the information and your flow is ready to be deployed.
See the steps in the GIF below:
For more information, read the documentation on Deploy. |
Deployment status and execution logs
To check out the deployment status, go to the Deployments page. You will also see other information such as deployment date and time.
To check out the execution logs, go to the Executions page.
By clicking in the icon, in the column Details, Sensedia Analytics will open. You will see request and response logs from connectors and For Each.
See the GIF below:
Share your suggestions with us!
Click here and then [+ Submit idea]