Skip to main content

Automation Question. Reduce number field value by one every day

  • May 25, 2022
  • 5 replies
  • 65 views

Forum|alt.badge.img+4

I have a database with a number field that external automation will set to a value at certain times. I then require that value to be reduced by one every day until it reaches zero again.

I tried to set this up using Find Record and Update Record in automation but it doesn’t appear that it can do this with multiple records in one table at a time. :grimacing:

Is there a way to set this up? Possibly with some scripting?

5 replies

Rupert_Hoffsch1
Forum|alt.badge.img+21

Hi there! Yes, Airtable automations can’t perform calculations at this point. So this needs to be handled with a script (within automations). Trigger would be at a scheduled time daily and then the script runs and deducts 1 from a given number field. Is this always one specific field or various fields? If it’s one specific field, it would work like this:


Forum|alt.badge.img+16
  • Inspiring
  • May 25, 2022

If you are on the free plan and do not have access to Automation Scripting, you can add this formula to count the number down every day. Then an automation that triggers on the update of the formula, to copy the formula result and update the number record

Number-DATETIME_DIFF(TODAY(),DATETIME_FORMAT(CREATED_TIME(),'L'),'days')

Forum|alt.badge.img+4
  • Author
  • Known Participant
  • May 25, 2022

Thanks! I’ll check out these options. I’m on the paid plan btw.

For now I set it up in the Integromat scenario that does other stuff with the database and tbh it doesn’t use up too many extra operations so I may leave it like that for now. :blush:


Forum|alt.badge.img+4
  • Author
  • Known Participant
  • May 25, 2022

Hi there! Yes, Airtable automations can’t perform calculations at this point. So this needs to be handled with a script (within automations). Trigger would be at a scheduled time daily and then the script runs and deducts 1 from a given number field. Is this always one specific field or various fields? If it’s one specific field, it would work like this:


It is for a number of fields.


Alexey_Gusev
Forum|alt.badge.img+25

It is for a number of fields.


you can still solve by automations, creating formula field with your field-1 and put it’s value where you need. or if your table should not contain extra fields, create mini-table for that