Isaiah
July 21, 2020, 7:49pm
1
I wanted to share this great explanation from @Razi on how Automations work with different triggers. Note that this is a discussion of the automation builder accessed under the lightning bolt icon on the very left, not the automations created under the actions tab of an object's properties in the app builder.
This is an exerpt from @Razi 's reply to another post:
In general the way Automations work is they operate stand-alone and based on the type of trigger, you may have a data source (that triggered the automation) that you can use in the Action. The data source typically refers to the Row in a table that was the source of the trigger.
In the case of Row Added/Deleted, the Row that triggered the automation will be the data source and can be accessed by ThisRow(). The same is true for Column Changes as well, but note that the automation will loop over multiple rows - and each time it loops over, you have access to ThisRow() that triggered the automation.
However, for Date/Time or Cell Changes, there is no data source that triggered the automation. Since you specified the data source as Cell Changes, and you can reference the cell directly (e.g., A2), then there is really no additional context that is needed beyond the cell reference.
Now in the Action part of the automation where you are specifying Update or Insert Rows, you have an ability to match which rows to update. Or in the case of inserting rows, there is no matching needed.
For matching, you can (1) use the data source if available (Row Added/Deleted or Column Changes), (2) match based on a formula - such as a cell comparison, or based on a formula like =FINDROW() or (3) leave it blank to insert rows.
In your case, since you are using Cell Changes, you can use #2 or #3 case above - since no data source would be available.
BTW, the Cell Changes trigger is a very infrequent use case.
5 Likes