Skip to main content
Question

Set All values in a specific column to zero on button press.


Forum|alt.badge.img+1

I have a column of numbers. I would like to be able to press a button on an interface and set all values in that column for all rows to zero using a button automation trigger. 

 

Could someone please give a step by step guide?

I can create an interface button linked to a record picker that updates the values one at a time… but that is quite tedious. 

 

Please advise, thank you!

 

4 replies

Alexey_Gusev
Forum|alt.badge.img+23

Hi,
how many records do you have in table?

If you want to run by button in interface, you can use automation, with Find Records - Repeating Group, but it has limitation, not sure - is it 100 or 1000 for such action.
Other way - use scripting step.
you don’t need input data

set your Table and Field names. 

note that if your field is text, value is ‘0’ (text), but if it is number, should be 0 (number).   And if Single-Select..well that’s a long story.
 

const table=base.getTable('YOUR_TABLE')
const query=await table.selectRecordsAsync({fields:[]})
const setZero=({id})=>({id,fields:{'YOUR_FIELD':'0'}})
const updates=query.records.map(setZero)
while(updates.length) await table.updateRecordsAsync(updates.splice(0,50))

 


TheTimeSavingCo
Forum|alt.badge.img+28

The limit for a Repeating Group is 8000, so the main limiter would be the Find Records action limit of 1000!


Mike_AutomaticN
Forum|alt.badge.img+23

As last resource, you could also have the button on your interface open an external url on a new tab which is actually a webhook which triggers a Zapier, Make, or n8n automation (I would personally suggest n8n).

For more information on which automation tool is best for you, you can check out this other article.

On your n8n automation you can have a webhook response to close the tab, and you can then set the automation to achieve what you are describing without the Repeating Group or the Find Records limits.

Feel free to reach out if you need any help setting this up, or if you have further questions on it!

Mike, Consultant @ Automatic Nation


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6007 replies
  • April 15, 2025

Do you want to set the column to zero for all records in the table, or just the records currently displayed in the interface?

 

The script provided by Alexey will set the column for all records in the table, which may not be what you want.

 

If you want to set just the records currently displayed in the interface, it gets a bit trickier. 

If the records in the interface have been selected based on user-set filters, you are out of luck. Currently there is no way for an automation to know what the filters are, so the automation cannot determine which records to act upon.

If the records in the interface are are grid of linked records that are all linked to the same parent record, with no filtering, you  can use a repeating action group based on the value of of the linked record.

If the records in the interface are a grid of records based on a predetermined filtering condition, you can use a find records action based on the same filtering conditions.

 

Depending on the type of interface element you use, (grid, list, etc.) you might be able to bulk copy/paste or drag down the blank cell value. It is a different user experience from clicking a button, but it is an alternative to consider if you have trouble getting the automation setup.


Reply