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

  1. Open a Desired Project: Log in to DBSync Cloud Workflow and navigate to the project where you want to implement the "For" condition.

  2. Create a New Task: Click on the drop-down next to Task and select Create.

  3. Name Your Process: Enter a name for your process (e.g., 'Sync SGDS Customer') and click Select Agent.

  4. 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.

  5. Configure the Flow: Click Configure. You will be redirected to the Flow screen.

  6. Drag and drop a Flow action into the workspace. Click Configure and provide a desired name for your project.

  7. Add a Query Operation: Drag and drop a Query action into the flow. Click Configure.

  8. Define the Source as Salesforce and select your account. Specify the Opportunity you want to query.

  9. Add the For Condition: Drag and drop the For condition into the flow.

  1. Configure the For condition to iterate over the products associated with the queried Opportunity. This allows you to process each product individually.

  2. Set Up Conditional Logic: Inside the For condition, add an If Condition to check if the account name matches 'SGDS'.

  1. If the condition is met, proceed to the next steps; otherwise, you can choose to skip or log the iteration.

  2. 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.

  3. 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.

  4. 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.

Frequently Asked Questions (FAQ)
  1. What does the "For" condition do?

The "For" condition allows you to iterate over a collection of data, processing each item individually within your workflow.

  1. Can I use the "For" condition with any data source?

Yes, the "For" condition can be used with any supported data source integrated within DBSync Cloud Workflow, such as Salesforce, databases, or other connectors.

  1. What happens if there are no items in the data set?

If there are no items in the data set, the "For" condition will skip the iteration process without executing any actions inside the loop.

  1. Can I add other conditions within a "For" loop?

Yes, you can add "If Conditions" or other conditional logic within a "For" loop to further refine your workflow's behavior based on specific criteria.

Last updated