Skip to main content

Is it possible to know what change triggered an automation in a script?

  • March 2, 2021
  • 2 replies
  • 25 views

Forum|alt.badge.img+3

I’d like to optimize my automation by running the same automation whether any field is updated, but perform a change related to the updated field only.

How can I know what field was updated from a script?

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • March 2, 2021

The script cannot identify the updated field on its own. However, you could have formula fields do this. You could have last modified time fields for each of the inputs, and have the script compare the last modified times with the current time. Or you could have a formula field that uses last modified times to identify the field that was modified last.


Forum|alt.badge.img+3
  • Author
  • Inspiring
  • March 2, 2021

The script cannot identify the updated field on its own. However, you could have formula fields do this. You could have last modified time fields for each of the inputs, and have the script compare the last modified times with the current time. Or you could have a formula field that uses last modified times to identify the field that was modified last.


Thanks but that won’t be reliable, but the time the automation runs, other fields may have been changed and it might not use the field that actually triggered the automation.