Help

Re: Automation step is executed before another step is finished

Solved
Jump to Solution
383 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Miles
5 - Automation Enthusiast
5 - Automation Enthusiast

I ran into a strange problem in an automation.

I am using a script to gather some data from two tables and combine it into a rich-text field. In the next step, I send out an e-mail with the content of this field. Turns out the e-mail is sent before the script has updated the text field!

Even adding a 3 second delay in the script does not solve the issue.

Curious if someone has a solution in place?

Thank you!

2 Solutions

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

The problem is not the actions running out of order. That is why adding a delay does not fix the issue. 


The send email action is getting the field value from when the automation was triggered, not the value when the action is run. 

There are two basic solutions. Pick whichever makes the most sense to you. 

Do a fresh read of the record after the script executes with a “find records” action. Grab the field value from the “find records” action, not the trigger. 

- Have your script output the value using output.set(). Use the value outputted by the script in your email. 

See Solution in Thread

Miles
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi @Mike_AutomaticN

Thank you, using output.set() in the script was the method I tried and makes much more sense in this context.

Thanks for your help!

See Solution in Thread

4 Replies 4

Hey @Miles!

This actually strange, and I do not see how that is possible unless your email gets triggered on a different automation (e.g. when the rich text field is not empty, or when it is updated).

However, you might want to explore including some sort of "Output.set()" on your script, and using the value obtained from such output on the body of the email -rather than the actual data from the updated field.

Please let me know if this is somehow helpful, or otherwise feel free to provide further context.

Best,
Mike, Consultant @ Automatic Nation

kuovonne
18 - Pluto
18 - Pluto

The problem is not the actions running out of order. That is why adding a delay does not fix the issue. 


The send email action is getting the field value from when the automation was triggered, not the value when the action is run. 

There are two basic solutions. Pick whichever makes the most sense to you. 

Do a fresh read of the record after the script executes with a “find records” action. Grab the field value from the “find records” action, not the trigger. 

- Have your script output the value using output.set(). Use the value outputted by the script in your email. 

Miles
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi @Mike_AutomaticN

Thank you, using output.set() in the script was the method I tried and makes much more sense in this context.

Thanks for your help!

Miles
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi @kuovonne ,

Thank you, so helpful! Have a better idea now how these things work in AT

xMiles