For (Loop)
Learn how to create conditional workflows
Introduction
The "For" condition in DBSync Cloud Workflow allows users to create customized workflows by iterating over collections of data. This enables dynamic processing based on specific criteria, making it possible to perform various operations like insert, upsert, or update from a source to a target.
Prerequisites
Before you begin, ensure you have:
A configured project in DBSync Cloud Workflow.
The necessary connectors (e.g., Salesforce and QuickBooks) set up.
Step-by-Step Process
Open a Desired Project: Log in to DBSync Cloud Workflow and navigate to the project where you want to implement the "For" condition.
Create a New Task: Click on the drop-down next to Task and select Create.
Name Your Process: Enter a name for your process (e.g., 'Sync SGDS Customer') and click Select Agent.
Assign to Bot: From the list of options, choose 'Assign to Bot' to create an automated workflow. You can also choose to maintain manual tasks by selecting other options.
Configure the Flow: Click Configure. You will be redirected to the Flow screen.
Drag and drop a Flow action into the workspace. Click Configure and provide a desired name for your project.
Add a Query Operation: Drag and drop a Query action into the flow. Click Configure.
Define the Source as Salesforce and select your account. Specify the Opportunity you want to query.
Add the For Condition: Drag and drop the For condition into the flow.
Configure the For condition to iterate over the products associated with the queried Opportunity. This allows you to process each product individually.
Set Up Conditional Logic: Inside the For condition, add an If Condition to check if the account name matches 'SGDS'.
If the condition is met, proceed to the next steps; otherwise, you can choose to skip or log the iteration.
Insert Customer into QuickBooks: If the account name matches, add an action to insert the customer into QuickBooks using the relevant product and opportunity data.
Debugging: Add a Debug action to print the results of the operation. This will display a debug card with the details of the products associated with the Opportunity.
Run the Workflow: Click the Run button to execute the workflow. The products listed under the Opportunity will be printed as cards, and if the account name matches, a customer named 'SGDS' will be created in QuickBooks.
PRO TIP
When using the "For" condition, ensure that your data set is well-defined and that the items being iterated over are relevant to the operation you intend to perform. This will help avoid unnecessary iterations and improve workflow efficiency.
Related Content
Implementing Conditional Logic with "If Conditions": Learn how to apply conditional logic within your workflows to dynamically control the execution of tasks and flows.
Creating and Managing Queries: Discover how to build and manage queries for retrieving and validating data across your integrations.
Debugging Flows: Explore techniques for troubleshooting and debugging your workflows to ensure they run smoothly and efficiently.
Last updated