cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vahrameev
New Member

Add local CSV file for parsing

Hello

 

I'm having problems adding local CSV (from my PC) to my flow in order to parse it

 

Currently I'm using the OneDrive connection and it's working fine:

 

01.jpg

 

But I don't like this option and I was trying to get the same result after uploading a local csv:

 

02.jpg

 

But the problem is that after uploading the file I see just a line of symbols in contentBytes and don't understand what is wrong

 

03.jpg

 

Can you please tell me what am I missing and if this can be done in the first place?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Try changing your splitNewLine action to use this code:

split(base64ToString(outputs('Get_file_content_using_path')?['body']?['$content']), decodeUriComponent('%0D%0A'))

This will decode the content back to a string and then you should get your array of lines.

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

View solution in original post

4 REPLIES 4
Paulie78
Super User
Super User

What is the file extension of your file? Try changing it to .txt. What you are seeing is the base 64 representation of your file where the Content Type has not been automatically determined. You can decode it, but renaming the file should give you the expected result.

thank you for your answer

 

I'm trying to import the .csv file

changing .csv to .txt gives me the same result

 

when I'm importing this .csv file from OneDrive, I have no problems with it at all

Paulie78
Super User
Super User

Try changing your splitNewLine action to use this code:

split(base64ToString(outputs('Get_file_content_using_path')?['body']?['$content']), decodeUriComponent('%0D%0A'))

This will decode the content back to a string and then you should get your array of lines.

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

thank you

after you've said "You can decode it" in your previous message I did it exactly like this and it's working great

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,704)