Rollup collected is an action that calculates one value from a field of all collected records, for example a count or a total. In the action list, its description reads Rollup values from collected records. It's meant to help you summarize many records without a loop or a script, and to save the result in a variable for later steps.
You can use this action for many things, including:
Counting the open tasks of a project and writing the number into an email.
Adding up the amounts of all unpaid invoices and saving the total on the customer's record.
Note:
Collect first. The action needs a collection created by an earlier action, such as
Search for records,Get view, orGet related. Without one,Select a fieldshowsNo results.Each collecting action returns up to 1,000 records. If more records match, the result is cut to the first 1,000 without a warning. The rollup covers every record in the list.
The result is a variable, not a field. To keep it, use it in a later action such as
Update record.
Who can use the Rollup collected action?
Automations are available on the Free, Plus, and Premium plans. The number of automation actions per month depends on your plan. See the limits for your plan on our pricing page.
To add or change this action, you need to be a workspace admin of the workspace the database app is in. You also need full access to every database the automation uses.
Add the Rollup collected action
To roll up values from collected records:
Open the database app and click the automations icon at the top right (
Create and view automations).Open an automation, or select
New automationand choose a trigger.Add an action that collects records, for example
Add action→Search for records.Select
Add action→Rollup collected. The step appears asRollup collected values.Check the field of the collected records to calculate from. Tape preselects a field of the nearest collection above this action. Select its name to choose another field. Without a collection, it reads
Select a field.Select the calculation next to
calculate. It starts asCount all.Select the name next to
and save in, and rename it if you want to find the result later. It starts asRollup.Select
Save changes. For a new automation, the button readsCreate automation.
Rollup collected settings
The action reads as a sentence: Rollup collected values from a field, calculate a calculation, and save in a variable.
Select a field: the field of the collected records that the rollup reads. The list shows fields of the collections created by actions above this one. Without a field, the action is skipped.calculate: the calculation. Select it to open the list. For every field, you can choose:Count allcounts all collected records.Count emptycounts the records where the field is empty.Count not emptycounts the records where the field has a value.Percent emptyshows the share of records where the field is empty.Percent not emptyshows the share of records where the field has a value.Number calculations: for number fields, and calculation fields that return a number, you can also choose
Sum,Average,Median,Min, andMax.and save in: the name of the variable that holds the result. The default name isRollup. Give it a clear name, such as "Total unpaid", when you use more than one rollup. Insert the variable in later actions by typing@. When you rename it, the variable name changes with it. In scripts,Total unpaidbecomesvar_total_unpaid.
The result is one value for the whole collection. A rollup doesn't change the collection or your records.
Let's look at an example
Let's say your finance team wants every customer to get a summary of unpaid invoices when a statement is sent. Here's how:
Set the trigger to
When a record is updatedin the database appCustomersand select the fieldStatement.Add the filter
WhereStatementHas changed to"Send".Select
Add action→Search for records, select the databaseInvoices, and add filters so only unpaid invoices of this customer are collected.Select
Add action→Rollup collected.Select the preselected field and choose
Amount, set the calculation toSum, and rename the output to "Total unpaid".Select
Add action→Update recordand insert theTotal unpaidvariable into the fieldOpen balanceon the customer.Select
Save changes.
When a statement is sent, the customer's Open balance shows the total of all unpaid invoices. If you only want the number of unpaid invoices, use Count all instead.
Rollup collected errors
If the step fails, the run shows the step and its message in the automation's runs. Open the automation and select
▷next toManual run(View all runs,cmd/ctrl+1). Each run shows its status, for exampleSuccess; select a run to see every step. For all automations, openRunsin the Automation Center and filter byApp,Automation, orStatus.If
Select a fieldshowsNo results, add a collecting action above this one.If the field you select has no values,
Count emptystill gives a result. For an empty list,Sumand the counts return 0.Average,Median,Min, andMaxreturn an empty value.
Test, pause, or edit the Rollup collected action
Manual runruns the automation once. It appears after the automation is saved. UnderRun on, select the records, then selectStart run(Save and start runif you have unsaved changes). Actions that use the result, such as updates or emails, work on real records.New automations you create in the editor are
Activeright away. The status,ActiveorPaused, sits below the automation's name in the editor. To pause one, select the status to switch it toPaused, then selectSave changes.To change the action, open the automation, select the
Rollup collected valuesstep, make your changes, then selectSave changes.The action's menu has
Settings,Continue on error,Deactivate,Turn into,Duplicate, andRemove. Learn more about action settings →
Learn more
FAQs
Do I need a loop to add up values?
Do I need a loop to add up values?
No. Rollup collected calculates the value over the whole collection in one step. Use a loop only when each record needs its own steps. Learn more about loops →
Can I add up amounts?
Can I add up amounts?
Yes! Select the number field, then select Sum. It's available for number fields and calculation fields that return a number.
How do I use the result?
How do I use the result?
Type @ in a later action and select the variable you named next to and save in. You can write it into a field with Update record, add it to a comment, or put it into an email.
Can I roll up records that aren't related to the current record?
Can I roll up records that aren't related to the current record?
Yes. The rollup covers whatever your collecting action returns, for example all records of a database app that match a filter. To limit it to related records, use Get related to collect them.
Is there a limit for the number of records?
Is there a limit for the number of records?
Yes. A collecting action returns up to 1,000 records. Learn more about limits →
Are there other actions I can use?
Are there other actions I can use?
Yes! Actions can create and update records, add comments, send emails, create PDFs, call other services, and more. See every action in Automation actions →
Are you a developer using the Tape API for automations?
Are you a developer using the Tape API for automations?
The automation API has its own documentation for developers. Full reference: rollup_iterable_values in the developer docs →
Still have questions? Find answers and get help from community experts in the Tape community →
