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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,001)