Foreach Loop

Description

The Foreach Loop action allows you to iterate through all records within a specified table in a Tabidoo application. This functionality enables workflows to systematically process each record, applying actions or logic to individual entries. Records can be filtered based on specific criteria applied to any field in the table.

Configuration Options

Source Table

Select the table containing the records to iterate through.

Ensure the user has sufficient permissions to access this table and its data.

Filter Criteria

Apply filters to narrow down the records to be processed in the loop. Filters can be applied to any field in the table. Examples:

Date Field: Include records with dates before or after a specific datetime (e.g., Due Date > 2025-04-01).

Status Field: Process only records with certain values (e.g., Status = 'Completed').

Custom Fields: Apply conditions to any other field, such as filtering by numeric values (Amount > 500) or specific text entries (Category = 'Urgent').

Loop Variable

Use the Loop Variable to reference each record during the iteration.

Loop Actions

During the Foreach Loop action, you can configure additional steps to be applied to each record in the selected table. The available actions include:

Send Email: Sends an email to specified or dynamically calculated recipient(s) based on the data in the current record.

Send Notification (BETA): Sends a notification to the notification center, directed at specific or calculated user(s).

Send to Slack: Posts a message to a designated Slack channel, allowing communication and collaboration based on workflow data.

Send Webhook Action: Triggers a webhook to send data or initiate actions in external systems.

Run Script: Executes custom JavaScript code defined by the user to perform advanced operations or calculations.

Create Report: Generates and processes a report from Tabidoo, which can then be used for exporting or sharing data.

Workflow Condition: Enables conditional interruption or branching of the workflow based on criteria evaluated during each loop iteration.

Confirmation Message Box: Displays a query to the user, prompting for confirmation to continue or alter workflow execution.

Use Cases

Processing Date Fields: Iterate through records to apply logic based on date comparisons, such as filtering overdue tasks or upcoming deadlines.

Batch Updates: Modify multiple records in a table based on shared criteria, such as updating the status of all "Pending" tasks.

Data Export or Transformation: Extract and transform data in one table before saving it into another destination.

Advanced Reporting: Generate summary data by looping through individual records and aggregating results dynamically.

Workflow Automation: Automate repeated tasks across records, minimizing manual intervention.

Notes

Filters help optimize performance by limiting the number of records processed in the loop.

Filters can be applied to any field, including date, status, or custom columns defined in the table structure.

Ensure your table structure supports the intended workflow logic, especially when combining filters and actions.

Test the workflow on a small set of records to validate configurations before applying it to large datasets.

Note: The Foreach Loop is not recommended for a large number of records, as it can slow down the workflow and potentially hit workflow limits or API call limitations. For example, external API calls like await doo.table.getData() can introduce delays and impact workflow performance. Consider alternative methods for processing large datasets.