Retool email attachments failing even when file exists

I'm trying to attach a PDF to an email and keep running into the error "Use File Input component to upload a file and ensure file is uploaded before query is fired."

Using the inspector, I believe my file has uploaded (see screenshot), and I've read a few posts making sure I format the attachment function correctly. However, I can't seem to get it. Can someone help me?


Edit: I used the new format of selecting the file component and it works now. However, I want to use the expanded format so I can change the file name. Please let me know how I can do this. Thanks

Hi @tiffany

The error doesn't indicate it, but I believe this is a syntax error in the file name - it's expecting a string value. I copied your attachment string (hopefully I copied everything correctly, but double check the names...) and just added quotes around the name portion:

[{data: {{fileInput2.value[0].base64Data}}, name: 'Manifest-{{manifests_admin_table.selectedRow?.mtn}}.pdf', contentType: {{fileInput2.value[0].type}} }]
2 Likes