cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Collector
Kudo Collector

save as csv does not recognize unicode output from sql

Hi,

i am building a flow that would be triggered from PowerApps button, to run a SQL query and then save the output in csv file (check screenshot) Screenshot (55).png

the problem is my SQL table contains columns with Arabic letter data, and when it is saved as csv it is scrambled!the output saved filethe output saved file

 

 

but when i change the flow to save the sql query output as *txt file, here the Arabic letters are fine and intact.

 

so is there a way to directly let it save unicode csv file?

 

Note: my column type in SQL is (nvarchar)

 

thanks,

Mohammad

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: save as csv does not recognize unicode output from sql

Hi @mokhawaja,

 

Have you tried to open the file with a different option such as Word document to see if it will be OK?

 

Please check your SQL query, and make sure they are running without problems.

 

I have tried the Create CVS table action on my side, it got value from SharePoint list using the action Get items, then when I opened the file with Excel/Word document, it wasn’t scrambled.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Kudo Collector
Kudo Collector

Re: save as csv does not recognize unicode output from sql

hi @v-yamao-msft,

i tried to open it in Word, and it prompt "File Conversion" (check screenshot), and it reads correctly, but i need it to open in excel as i am planning to send this file to my users as attachment, and i want to make their lives easier by directly using the file in excel.

Screenshot (57)_LI.jpg

 

 

thanks,

Mohammad

 

Highlighted
Regular Visitor

Re: save as csv does not recognize unicode output from sql

Hi,

 

I see this post is a bit old, but it might be relevant for some. I had the same issue, getting the data from the DB, exporting to CSV and opening it in Excel. The character encoding was wrong, no matter what I tried to do.

 

But! I opened the same CSV file in Notepad++ and the characters were correct. You can also check the results in the "Create CSV Table" Output, the characters should be good there too.

 

So it turns out that Excel automatically set the character encoding to some default value (I assume this is based in your regional settings in Windows) when you open the file just by double clicking, but this is not the way to import data from a CSV to Excel.

 

Solution:

Go to the Data tab on the ribbon, select import from CSV and change the character encoding to the correct one. For me it was UTF-8.

 

OpenCSV.png

 

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (10,509)