web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Read CSV file from att...
Power Automate
Answered

Read CSV file from attachment in Outlook

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

 

I'm working on a flow that is triggered when a new email arrives in a shared mailbox (V2). The email contains a CSV file that I need to parse to JSON Array, but I cannot seem to connect the dynamic content from the CSV file to my flow.

 

For testing purposes, I pasted what my CSV file would look like in the second step of my flow called 'Compose CSV'. In the further steps, I've followed up on the output from Compose CSV to convert the csv data into Array.

 

I got this to work, but I'm stuck now that I want to use the dynamic content from the e-mail. I've tried to replace the expression: @{split(outputs('Compose_(CSV)'),outputs('NewLine'))} by referring to the trigger output: @{split(outputs(triggerOutputs()?['body/attachments']),outputs('NewLine'))} but I get an InvalidTemplate 

 

Which dynamic content do I need to use to get my flow to work from emailed csv data? And is it correct that I can change the input of the split expression for this to work? Or do I need to change my flow? See picture for my current flow. Let me know if I need to clarify something. I am quite new to building these kinds of flows so any help would be appreciated.

Categories:
I have the same question (0)
  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Please check this link:Power Automate: How to parse a CSV File to create a JSON array (tachytelic.net)

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_2-1698975176021.png

    vyetonggumsft_4-1698975366603.png

    vyetonggumsft_0-1698990581649.png

     

     

    base64ToString(outputs('Get_Attachment_(V2)')?['body/contentBytes'])
    split(outputs('Compose'), decodeUriComponent('%0D%0A'))
    skip(outputs('splitNewLine'),1)
    split(item(), ',')
    outputs('splitByComma')?[0]
    outputs('splitByComma')?[1]

     

     

    My CSV File Content:

    vyetonggumsft_1-1698990699131.png

    Best Regards,

    Sunshine Gu

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 67

#2
David_MA Profile Picture

David_MA 64 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 39 Most Valuable Professional

Last 30 days Overall leaderboard