Help

created records via Parser by zapier

1442 4
cancel
Showing results for 
Search instead for 
Did you mean: 
hansenpansen
4 - Data Explorer
4 - Data Explorer

Im using Parser by Zapier to receive mails and create a record with certain infos mapped to my columns. One of which is the Mail Attachment to be placed in a File Column in Airtable. Somehow the file gets renamed on the process. In my example I send "invoice-60.pdf" to the zapier parser. It got added to the record as "9UngNgXzKLZ3jsMlQmQBOa95o1I5ENxS9LaFRxLNIfNkfLjB0I3ul64-P893QYjt62uhsUPyHBMe_P2i65Zv7-O3qjclkk4ACMI72H8AytGuav9QrcSMjQ1w8Sc1t4_UWDuEuGw6wGENXNjHf3XzQlMf2LLiwwxSveX6kdXYwBk"

Somehow the .pdf end got lost in the process. 

I need to use an Airtable automation to send an email containing that file to a specific address when the status is changed. Due to the lack of .pdf ending the receiving system doesn't recognize the file and rejects it. 

Bizarre enough, i can open it in Airtable and take a look at the filename, there is no .pdf at the end. When I download it though, the .pdf end is in the filename again... maybe it got added while downloading it?

I tried to upload a .pdf file to the record directly and it kept both the original name and the ending. Also the automation works for sending a mail once the status changes.

Therefore I think it has to do with the renaming in the process of fetching the mail and adding it as a new record.

Any idea how to fix that?

 

im excited to hear your thoughts, sincerely

Hannes

4 Replies 4

Sorry, I don’t know the answer to your question because I stopped using Zapier many years ago, so hopefully someone else will have the answer for you below!

However, in the meantime, while you’re waiting for an answer below, I wanted to let you know that you can successfully do this with Make, which is a much more powerful & much cheaper alternative to Zapier.

Make will not change the name of your files nor the file extensions as it sends them to Airtable.

There is a small learning curve with Make, which is why I’ve assembled a bunch of Make training resources in this thread.

Your best bet's going to be using another email parser I'm afraid.  Email Parser by Zapier doesn't give you full access to the file name and extension, and your file just ends up being their automatically generated file name instead

Assuming:
1. The file name doesn't matter and only the extension matters
2. You're on a Teams or above plan and have automations to spare

You could use a script action to handle this for you too I think, and here's something I threw together:

let {attachmentURLs, recordId} = input.config()

let table = base.getTable("Table 1")

// Reattach the item with the new filename
await table.updateRecordAsync(recordId, {
    "Attachments": [{url: attachmentURLs[0], filename: "file.pdf"}]
})

And it should look like this with the variables set up:

Screenshot 2024-02-05 at 12.21.41 PM.png

It basically just reuploads the file, and forces it to be a pdf

Do take note that when you're setting up the attachmentURL variable you need to set it to be the expiring download URL:

Screenshot 2024-02-05 at 12.21.02 PM.png

Wow thanks! That solution works like a charm. Only thing now is, that the script seems to be not fast enough to rename the file.

My current automation flow: status changes to 'upload' -> run script action (rename it) -> send email

It seems that the email is send before the file is done being renamed. When I firstly run the automation, the Email is send with the old Attachment name (without the .pdf extension). The second time I trigger the automation, the mail gets send with the correct file.pdf attachment from the previous run.

Is there a way to delay the email, to give the system time to rename the file?

I already tried running the script beforehand, like when the initial record is created via email reception. But that doesn't work so far

 

thanks in advance!

Oh that's because all actions in an automation use data from the initial trigger, so it's taking the file from before the script action was run

You're going to need to add a "Find Record" action to look for the triggering record, then use that "Find Record" action's results in your email, does that make sense?