Sep 23, 2020 05:05 PM
Hey, I’m trying to add an attachment to my action email in response to a trigger. The attachment is PDF or PNG and is in an Attachment field. But every time I run a test, it gives me test error:
Step failed.
Failed to construct the value for “Attachments”.
How do I get it to read the value? Your help is appreciated.
Solved! Go to Solution.
Sep 24, 2020 11:37 AM
Did you test the trigger step before or after adding attachments to the sample field? Airtable doesn’t automatically refresh the sample data pulled by the trigger step. If you build the trigger step, tested it, and then added the attachments, you would need to re-test the trigger step for it to find and use those items in later actions.
To see exactly what data the trigger step is working with, click the “Test ran successfully” line:
You’ll then see the details of the sample record it found. Click on “Field values” to see the contents of each field from that sample record.
Notice in the example above that there’s no mention of the {Attachments}
field in the field values. That’s because I added those two attachments after testing the record, and the test data still contains nothing for that field. I have to re-test the trigger, and then I’ll see that field show up (I won’t see the contents, but the presence of the {Attachments}
in the field values list means that it contains data that can be used):
Long story short: when in doubt, check the test data of the trigger/action that you want to use to ensure that the data is actually available.
Sep 23, 2020 11:51 PM
Works fine over here when you press ‘Insert’ on the attachment level.
Sep 24, 2020 05:08 AM
Nice find, @Tuur!! :slightly_smiling_face:
This dedicated attachments field is a relatively new addition to the outgoing automated emails!! :slightly_smiling_face: Last time I was setting up automated emails for a client (a few weeks ago), the attachment field did NOT exist!
This is huge. :slightly_smiling_face:
Sep 24, 2020 07:18 AM
I’m inserting but it’s not working. Anyone else able to help?
Sep 24, 2020 11:37 AM
Did you test the trigger step before or after adding attachments to the sample field? Airtable doesn’t automatically refresh the sample data pulled by the trigger step. If you build the trigger step, tested it, and then added the attachments, you would need to re-test the trigger step for it to find and use those items in later actions.
To see exactly what data the trigger step is working with, click the “Test ran successfully” line:
You’ll then see the details of the sample record it found. Click on “Field values” to see the contents of each field from that sample record.
Notice in the example above that there’s no mention of the {Attachments}
field in the field values. That’s because I added those two attachments after testing the record, and the test data still contains nothing for that field. I have to re-test the trigger, and then I’ll see that field show up (I won’t see the contents, but the presence of the {Attachments}
in the field values list means that it contains data that can be used):
Long story short: when in doubt, check the test data of the trigger/action that you want to use to ensure that the data is actually available.
Sep 24, 2020 12:07 PM
Justin! You are a GENIUS. That was it. (all the hours I spent reading and testing to solve this :face_with_head_bandage: ). Thank you