Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Send Email with csv attachment

(0) ShareShare
ReportReport
Posted on by 7

I am trying to send multiple .csv attachments in a single email bit it keeps failing stating "Invalid Template"  other file types I have tested and work flawless .png, .jpg, .xlsx no problem sending the email, It is only the .csv files that are failing. I followed this post to create the flow and used Expression "body('Get_attachment_content').$content" in the Array  instead of the SharePoint Get attachment.  

 

ERROR RECEIVED

InvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '1' and column '2325': 'The template language expression 'body('Get_attachment_content').$content' cannot be evaluated because property '$content' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

 

 The flow below works for all common file types except .csv.

 

JSON Array ValueJSON Array ValueError when trying to get .csv attachmentError when trying to get .csv attachment

  • tcarr Profile Picture
    2 on at
    Re: Send Email with csv attachment

    I have the exact same problem as the original poster.  All attachments seem to work fine with Flow except for CSV extensions.  Is this a known behavior/bug with Flow?  Is there a workaround that would allow me to build an error-handler for CSV files and treat them differently?

  • Stephen_Tyson Profile Picture
    7 on at
    Re: Send Email with csv attachment

     

    Here is the entire flow. 

    SendEmailAttachment.PNG

  • v-xida-msft Profile Picture
    on at
    Re: Send Email with csv attachment

    Hi @Stephen_Tyson,

     

    Could you please share a full screenshot of your flow's configuration?

     

    The issue is confirmed on my side, if the attachments related to the item is CSV files, the "Get attachment content" action returned is binary text representation of the content of CSV file and the output of this action doesn't include $content property:16.JPG

    But the output that we want actually as below:17.JPG

     

    If the attachments is CSV files, the "Get attachment content" action returned is binary data, but there is no way to analyze binary data in Microsoft Flow currently, so I afraid that there is no way to send multiple .CSV attachments in a single email.

     

    In addition, you could consider take a try to manually convert the CSV files into .XLSX files firstly and then send multiple .XLSX files in a single email.

     

    If you would like this feature to be improved in Microsoft Flow, please submit an idea to Flow Ideas Forum:

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    Best regards,

    Kris

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow