Skip to main content

I have an Invoice table. My automation setup is, when a record gets created, I run a script which calls an api (that api updates an Attachment field in the Invoice table) and then at last there is a Send Email action.

For some reason, the send email action does not send any attachments. Although I could see the files are added successfully by the api. Here I add attachment field from the trigger response.

I think, Send Email step is referring to the older values,  present during the start of the automation.

 

Now what works is, if I add an Update Record step in between Run Script and Send Email, and update some random field and then in Send Email refer the attachment field from Update Record action.

Just wanted to know if this is the expected behavior or not

Hey ​@pazhamalai,

A screenshot would allow me to confirm, but your understanding is correct.

Meaning: When you map the attachment field on your Send Email action block with a reference to the trigger block (when a record gets created) you are picking up only information available at the time of the trigger (i.e. record without an attachment, as the attachment was provided by the script block).

Not sure how easy it would be, but you could try to get the script do two different things: (i) Update the record with the attachment; and (ii) output the attachment itself in a format that can be then mapped on the email action.

However, the above might be overbuilding, and you might just have a (i) find record; or (ii) update record action just to get an updated version of the record which triggered the automation to then use such reference for mapping the attachment field on the send email action block.

Hope this helps!
Feel free to reach out as needed.

Mike, Consultant @ Automatic Nation


Hi ​@Mike_AutomaticN ,

 

Thanks for the detailed response. Yes, adding an find record or update record action in between, script and send email actions, works well.


Reply