cancel
Showing results for 
Search instead for 
Did you mean: 

Text (CSV) file - get rows

An action to get rows from a text file (CSV) would be handy.

Status: New
Comments
Advocate I

Agreed.

 

MS does not seem to want to step on Plumsail's toes here. They're probably making some $$ on the plugin sales.

 

Fox/Hen-house.

Advocate II

YES! 

Should also work like JSON Parser.  Meaning that every column header could be mapped to a variable accessible in subsequent Apply To loop for each row.

 

Please!! 🙂 

Community Champion

Approaching 4 years with a HUGE number of votes here... whats the deal? Why does this feature request still have the "NEW" tag? Should at least be "IN REVIEW" or the like.

 

Please pardon my rant (I'm working on that downside).

 

Instead, I'll offer a solution here. Ended up being fairly straightforward to parse .csv's uploaded to blob storage and write them to SQL. 

 

Trigger: Blob added to container

Control1: FOR ALL blobs added, `createArray(triggerBody()?['Path'])`

Control2: IF `CurrentItem ends with .csv`

Action1: Get Blob Content Using Path `CurrentItem`

Action2: Compose `body('Action1')`

Action3: (The first secret ingredient) Compose "@split(outputs(Action2, '\r\n')"

  - The key here, is that you MUST actually type the above into the Compose inputs box NOT THE EXPRESSION FIELD

  - See "Step 2" here: https://dynamicscitizendeveloper.com/2019/06/06/microsoft-flow-csv-integration-with-dynamics-365/

Control3: FOR ALL Action3, `skip(outputs(Action3, 1))`

  - This skips the header row in the .csv

Control4: IF `CurrentItem is not equal to "" `

  - For some reason, Action3 generates an additional blank row. This filters the blank row out.

Action4: (The second secret ingredient) Insert Row (SQL) 

  - In each SQL table column field, you need to add the expression `split(items('Control3'), ',')?[X]`

  - Where "[X]" = the position within the split array that needs to map to that given SQL column

 

Looks like this:

(bummer, can't put screenshots in Comments): Go here instead: https://powerusers.microsoft.com/t5/Building-Flows/How-to-parse-csv-s-to-SQL/m-p/766197/highlight/tr...

Advocate II

@ericonline

I agree with you.  I'm convinced they are protecting their business partners who are making money with their own csv parsers.  I think it a mistake!  But what upsets me the most is that they are not transparent about it.  They keep saying how grateful they are for all the help the community provides… then they should at least be honest with us.

Regular Visitor

Any update on this one Microsoft?