Skip to main content
Solved

Use automation to count up by one whenever field is edited

  • April 9, 2021
  • 6 replies
  • 144 views

I would like to have a number field that increments by one whenever the “most recent sale” date field is edited so we can sort products by the number of sales.

How do I make an automation that does cellA+1 when another cellB is updated?

edit: If anyone knows of a way to do this without a third field, I’d be obliged.

Best answer by ScottWorld

You could do this with an automation:

  1. Create a formula field that already has the next number ready to go. This formula field would just be “CellA + 1”. Then, you can hide this formula field because you won’t need to see it.

  2. Then, create an automation that triggers when your “Most Recent Sale” field has been updated. Have this automation update your number field with the value of your new formula field that you created.

Hope this helps! 🙂

6 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • Answer
  • April 9, 2021

You could do this with an automation:

  1. Create a formula field that already has the next number ready to go. This formula field would just be “CellA + 1”. Then, you can hide this formula field because you won’t need to see it.

  2. Then, create an automation that triggers when your “Most Recent Sale” field has been updated. Have this automation update your number field with the value of your new formula field that you created.

Hope this helps! 🙂


Justin_Barrett
Forum|alt.badge.img+21

This could also be done with a script action (if your base is in a Pro-plan workspace or higher). The script could read the existing number and bump it up by one.

The only problem is that it’s entirely possible that a single edit of the date might be viewed as multiple edits. There are ways around this, though. If you’d like to dig deeper on this topic, just holler.


matt_stewart1
Forum|alt.badge.img+17

This could also be done with a script action (if your base is in a Pro-plan workspace or higher). The script could read the existing number and bump it up by one.

The only problem is that it’s entirely possible that a single edit of the date might be viewed as multiple edits. There are ways around this, though. If you’d like to dig deeper on this topic, just holler.


@Justin_Barrett trying to do exactly as you say... add 1 to the value using a script action in my automation.

 

I managed to figure out how to pull in the record values using input variables, but don't know how to make the new number be a +1

 

 


Justin_Barrett
Forum|alt.badge.img+21

@Justin_Barrett trying to do exactly as you say... add 1 to the value using a script action in my automation.

 

I managed to figure out how to pull in the record values using input variables, but don't know how to make the new number be a +1

 

 


@matt_stewart1 Please share the code that you've created so far, and we can help you refine it.


Forum|alt.badge.img
  • New Participant
  • August 2, 2023

This could also be done with a script action (if your base is in a Pro-plan workspace or higher). The script could read the existing number and bump it up by one.

The only problem is that it’s entirely possible that a single edit of the date might be viewed as multiple edits. There are ways around this, though. If you’d like to dig deeper on this topic, just holler.


I have been pulling my hair out for weeks trying to do this exact same thing.  Are you able to please share the formula you used?  Thanks!!


Justin_Barrett
Forum|alt.badge.img+21

I have been pulling my hair out for weeks trying to do this exact same thing.  Are you able to please share the formula you used?  Thanks!!


A formula alone won't work. If the solution that @ScottWorld proposed isn't sufficient, my next go-do is code, and unfortunately I'm not in a position to delve into a code-based solution right now.