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

How to read csv file

(0) ShareShare
ReportReport
Posted on by 2

I have a flow that reads csv file line by line, and the flow has the following compose action:

array.JPG

the output will looks as the one below:

Capture.JPG

In the next step, I'm trying create a map to get each value from by using the compose action

 

 

split(item(),';')[0]
split(item(),';')[1]
split(item(),';')[2]

 

 

this works well for the first row, but not for the second one as it has a string with comma and the value is surrounded by \"   \" so the map will look as:

 

 

[
 "Name": "First item",
 "Description: "This is the test of the first item",
 "Amount": "1"
{
},
{
 "Name": "Second item",
 "Description: "\"The second",
 "Amount": "and last item\""
}
]

 

 

Could you help me to get the values correctly?

 

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    If your CSV data has commas within the values, it definitely makes it much harder to extract out.

     

    See my solution (link below) that uses Office Scripts to pass in a CSV file and it return the JSON data - including handling embedded commas.

     

    Solved: Re: Parsing a CSV that contains embedded commas - Power Platform Community (microsoft.com)


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard