Search code examples
csvtype-conversionazure-logic-appsazure-files

"Create file" action in Logic Apps cannot show special characters


To summarize shortly. I need to transform a big xml file into a .csv file while also chosing specific fields of data.

  1. I get a big xml file
  2. I convert it to Json using a Compose action
  3. I compose the fields I want from the json in a "Foreach"loop
  4. I append it to an array variable (Within the foreach loop)
  5. I use the "Create CSV table" action
  6. I use the "Create file" action from the "Azure file storage" and it successfully creates a .csv file that has the data I want.

These are my problems:

1. This is my "Create CSV table" action, you can see the name of the city "Göteborg"

So I can see that the data going into the "Create file" action can successfully show the letter " Ö ". However, this is how it looks when the final file is shown. "Göteborg"

Göteborg

I cannot figure out how to make sure that the special letters will be shown. I've tried things like "base64ToSTring" but it's not accepted since the data is an array.

2. The second issue I have is that my compose action is ordered alphabetically. So the final result I get in my file shows "City" infront of "FirstName" for example. I want "FirstName" to show first but after a lot of testing I cannot get it to order in the way I want.


Helpful for any tips on how to create this .csv file properly and in the way I want.


Solution

  • The design in Logic apps is right (the problem is in local the way it is storing):

    enter image description here

    Output as been stored as it is :

    enter image description here

    But when downloaded it shows this way(problem with local not azure):

    enter image description here

    Helpful for any tips on how to create this .csv file properly and in the way I want.

    So, the alternative way is created a normal file and then save it as UTF-8 with BOM and then save it as name.csv. Refer this SO-Thread for the same:

    enter image description here

    Then Download the file and then save it as:

    enter image description here

    then it will show the required format:

    enter image description here