• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

Uploading an email attachment to Google Drive gives the wrong filename

Status
Not open for further replies.

Anita

Member
Your Task History ID
IjU3NjUwNTZmMDYzZjA0MzY1MjY0NTUzNjUxM2I1MTYyNTQzOTBmMzgi_pc
Hi

I have a workflow that is designed to receive an email that has an attachment, give the attachment a sensible name, and upload to a specific folder in Google Drive.

When I test, each individual step of the workflow is correct, including saving to the Google Drive with the correct name.

However, when it runs automatically, I get the text of the email in filename instead of the result of my text formatter.

For example, for an email that starts with the following body text: "---------- Forwarded message --------- From: Cloudflare <[email protected]> Date: Thu, 20 Feb 2025 at 04:15 Subject: Your"

The steps are as follows:
  1. Email Parser (Pabbly).
    I have set up a mailhook email address and in my Gmail filters have specified the emails I want forwarded to that email address

  2. Filter (Pabbly)
    Checks that the email received does actually have an attachment. If so, it does...

  3. Date Time Formatter (Pabbly)
    Takes the Header Date in format "Ddd, DD Mmm YYYY THH:mm:ss Z" and outputs the date in format "YYYYMMDD". eg 20250220

  4. Text Formatter (Pabbly)
    Takes the Body Text of the email received and gets the From email name by looking for the text after "From:{{space}}" and before "{{space}}<" eg Cloudflare

  5. Google Drive: Upload a file
    URL: Attachment link from step 1
    Folder Id: goes into the right folder
    File Name: Result from Step 3 then an underscore character (_) then the Result from Step 4, so 20250220_Cloudflare
All these steps seem to be working correctly when testing.

But the file name when the workflow runs as an automation is in the format YYYYMMDD_EmailText

So the file names are extremely long and meaningless, eg 20250220_Hello FirstName Lastname, Attached is a copy of your invoice .............. Best, Cloudflare Billing Team

Can anyone see what is wrong or give advice about how to troubleshoot this?

I have entered a Task History ID in the box below, but it has happened on other occasions, and the email does not always come from Cloudflare.

Thanks,

Anita
 

Preeti Paryani

Well-known member
Staff member
Hello @Anita,

Upon thoroughly checking your workflow, we noticed that the trigger response you captured while setting up the workflow was from a forwarded email. This is why the text formatting worked correctly during testing, and everything seemed to function smoothly.

However, in the actual automation runs, the emails you are receiving (the one in your Task History) are not forwarded emails but regular emails. Since the text formatting was initially set based on a forwarded email structure, it does not find the expected "before" and "after" text markers in a normal email. As a result, the entire email body gets mapped instead, leading to the incorrect file name format in Google Drive.

To resolve this, we recommend capturing multiple email responses (both forwarded and regular) and adjusting your workflow accordingly to handle different formats. This should help prevent similar issues in the future.

1740460144411.png


1740460200684.png
 

Anita

Member
Thank you Preeti,

I changed the workflow to use the from email address but couldn't test until the start of the month. I'm pleased to say that the filenames of the two files so far received are:
This is enough to help me to identify which receipt file should be attached to which expense.

The only reason I was using a forwarded email in development was that getting the latest captured responses using the Refresh button did not work on this workflow.

Anita
 

Preeti Paryani

Well-known member
Staff member
Hello @Anita,

Upon reviewing the mapping and workflow data (both input and output), it appears that the name is being passed correctly. Could you please confirm if it is now working as expected and if your issue has been resolved?

Looking forward to your response.

1741004131271.png


1741004139579.png


1741004251360.png
 

Anita

Member
Yes, it's working as expected. In normal operations I should not have forwarded emails.
Request resolved.
Thanks for your help.

Anita
 
Status
Not open for further replies.
Top