Trigger on number of records changed

Prev Next

When building a pipeline that uses any trigger in the Quickbase channel, builders can define the number of records that must be added, modified, or deleted to cause the pipeline to trigger. To do so, use the Trigger on number of records changed setting when configuring the step.

This is useful when you have pipelines that use both single-event and bulk-event triggers in the same Quickbase table. Configure when each pipeline should trigger to prevent them from running simultaneously. For example, you may set the single trigger to run on a maximum of 9 record changes, and the bulk trigger to run on a minimum of 10 record changes. 

Warning

If you have pipelines that trigger on single and bulk changes in the same Quickbase table and don't explicitly configure this setting, they will both run at the same time. This can result in duplicate changes to records or inconsistent results if both pipelines try to update a record simultaneously.  

This article has examples of how to use this setting to configure when a pipeline runs on the same Quickbase table using single and bulk triggers.

Single trigger example

You want to notify your team when a new task is added, up to 5 items. Beyond that, getting email notifications for each new task isn't necessary.

To do this, create a pipeline with 2 steps:

  1. On New Event step to trigger the pipeline when a new task is added. 
    Configure the step to trigger on a maximum number of 5 records changed. 
    The On New Event step configuration showing Trigger on number of records changed set to a maximum of 5

  2. Send an Email step to notify the recipient.The single trigger pipeline showing the On New Event and Send an Email steps 

Bulk trigger example

You have a Project → Tasks table setup, where each task has a related project. When performing a bulk CSV upload of 100 records into the Tasks table, you want to set the relationship to the Project for each newly created Task.

The Project to Tasks table relationship structure

To do this, create a pipeline with 6 steps:

  1. On New Bulk Event step that triggers on records added to the Bulk Tasks table. 
    Configure the step to trigger on a minimum number of 10 records changed, to ensure the pipeline only runs on mass record changes, like grid edits or CSV imports.
     The On New Bulk Event step configuration showing Trigger on number of records changed set to a minimum of 10

  2. Search step to create a list of all the projects.

  3. Prepare Bulk Upsert step to set the related project for all tasks that are being inserted into the Tasks table.

  4. Loop to iterate through the array of records generated by the bulk trigger.

  5. Add a Bulk Upsert row to map the respective fields and set the related project with a Jinja iteration:
    {% for project in b %}
        {% if project["project_name"] == a.project %}
            {{ project["id"] }}
        {% endif %}
    {% endfor %}

  6. Commit Upsert in the Tasks table.

6-step pipeline triggered from the On New Bulk Event step

The Add a Bulk Upsert Row step configuration showing field mapping for the bulk trigger example