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:

flow1

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:

flow1 api key

  • OAUTH 2 - Client Credentials

See below how to register the OAUTH 2 - Client Credentials authorization that we will use for the SalesForce connector:

flow1 auth client credentials

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:

flow1 env var

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.

  1. In the left menu, select Triggers and then select Scheduler Trigger.

  2. Fill in the name of the trigger, which in the example will be "Every day at 12 am".

  3. Insert the corresponding Cron Expression. In this case, the expression will be "* * * 0 0".

  4. Click on Save.

See the steps in the GIF:

flow1 scheduler trigger

For more information, read the documentation on Scheduler Trigger.

General Tool: For Each

For Each will repeat the actions for each connector within the sub-flow.

  1. In the left menu, select General Tools and then select For Each.

  2. Fill in the name of the tool, which will be "For Each Product".

  3. In the Variable field, click on Properties and select "$.Get_Product_List.Response.Payload.value".

  4. In the Iteration Element field, fill in the name of the iteration element, which will be "Product List".

  5. Enable the Ignore Errors button.

  6. Click on SAVE.

See the steps in the GIF:

flow1 for each

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.

  1. In the left menu, select Connectors and search for the SalesForce connector.

  2. Fill in the connector’s name, which will be "Update CRM Catalog".

  3. Select the "POST/Product" route.

  4. Insert the URL.

  5. Keep the Request Timeout field with the default value: 3000.

  6. In the Security field, select "Authorization SalesForce".

  7. Click on Create Data Mapping.

  8. In the FROM column, select "$.Get_Description.Response.Payload.value.ProductDescription".

  9. In the TO column, select "$.Request.Payload.Name".

  10. Click on ADD MAPPING.

  11. Click on CONFIRM.

  12. Enable the Ignore Errors button.

  13. Click on SAVE.

flow1 update CRM catalog

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:

flow1 test mode

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:

flow1 deploy

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 open in newIcon 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:

flow1 deployments execution

Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]