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

Notifications

Announcements

Community site session details

Community site session details

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

Read CSV file from attachment in Outlook

(0) ShareShare
ReportReport
Posted on by

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard