web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / "Get file content" cha...
Power Automate
Suggested Answer

"Get file content" changes the file encoding. How to fix?

(3) ShareShare
ReportReport
Posted on by Microsoft Employee

"Get file content" and "Get file content with path" actions (SharePoint based) became to change the encoding of the file. It wasn't like this 2 weeks ago. Looks like a bug to me.
Original file: 

iroprish_0-1631923305503.png

Flow: 

iroprish_1-1631923349248.png

Result:

iroprish_2-1631923380421.png


 😞

Categories:
I have the same question (0)
  • iroprish Profile Picture
    Microsoft Employee on at

    I tried to use .xlsx output type instead of .csv. Also didn't work.

  • v-bofeng-msft Profile Picture
    on at

    Hi @iroprish :

    This Post may be similar to the situation you encountered, you may need to Use UTF-8 mode to re-import the file:

    1. Open Microsoft Excel
    2. Click on the Data menu bar option.

    vbofengmsft_0-1632124419326.png

     

    3. Select the file

    vbofengmsft_1-1632124419168.png

     

    vbofengmsft_2-1632124419163.png

     

    4.Choose UTF-8 Mode

    vbofengmsft_3-1632124419156.png

     

    The Result:

    vbofengmsft_4-1632124419347.png

    I think these links will help you a lot:

    Create a .csv file that uses UTF-8 character encoding 
    How to import a .csv file that uses UTF-8 character encoding 

    If you want this problem to be completely resolved, I suggest you consider posting your needs in this forum:

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas 

    Best Regards,

    Bof

  • ingmar Profile Picture
    2 on at

    I'm having the same issue when getting .txt files from an FTP and save it to Sharepoint
    the file on the FTP is encoded UTF-8 BOM when Power Automate get's the file content it shows the file content Binary

    so now characters like é or ü or ï are now ï¿½

  • Seabass Profile Picture
    4 on at

    Same issue here!

  • Community Power Platform Member Profile Picture
    on at

    It doesn't solve the problema in an automated way. I have a flow that read a csv file generated by a system, I cannot manually fix  the file every time.

     

    Is there another way to fix this?

  • murbanik Profile Picture
    2 on at

    Anyone?

  • rommelrueco Profile Picture
    2 on at

    You have to update the value of the File Content field in the "Upload File" task.

    From: File Content

    To: concat(uriComponentToString('%EF%BB%BF'),body('Get_file_content'))

     

     

    Note: 

    • You can type the updated value by clicking the "Expression" tab.
    • You can get the value of body('Get_file_content') by clicking the "Dynamic Content" tab and selecting the "File Content"
      rommelrueco_0-1697595818390.png

     

    Explanation:

    .csv file is a kind of text file. If you encode it in UTF-8 format, there are two ways to save it.

    - Text only

    Byte Order Mark(BOM)+Text

    BOM is 3 characters (EF BB BF) to mark the file is encoded as UTF-8.

    When you generate .csv file in Power Automate, it does not include BOM.

    So, when you open the .csv file in excel, special characters (i.e. Korean) will be broken.

    The solution is to add 3 BOM characters in front of the .csv file content before saving it.

     

    Let me know if this works. It is working fine using the "Create File" task. I haven't tested using the "Upload File" task.

    Rommel Rueco

  • Linn9000 Profile Picture
    4 on at

    I had the same issue in a somewhat different case (copying a CSV file from SFTP to Sharepoint).  CSV file wasn't the same after copying.

     

    To fix the CSV issues, i set "Infer Content Type" to "No".  After this, my CSV encoding stayed the same

    Linn9000_0-1699884153345.png

     

     

  • CU06031955-0 Profile Picture
    7 on at
    I just ran into this problem but it was similar to something I solved before.

    The expression that seems to fix this is:
     
    binary(setProperty(body('Get_file_content_using_path'), '$content-type', 'octet/stream;charset=windows-1252'))

    I don't really understand why "charset=windows-1252" works but "charset=utf-8" does not. but this expression solved it for me.
  • Suggested answer
    MA-11041301-0 Profile Picture
    3 on at
     With the help of  5 on 06 Mar 2025 at 21:58:28
    Create a Compose with this Input:
    concat(uriComponentToString('%EF%BB%Bf'),setProperty(outputs('Get_file_content')?['body'], '$content-type''application/octet-stream;charset=Windows-1251'))
     
    Or just be sure to use utf-8 encoding!
    • Convert the CSV to UTF-8 before processing:

      1. Open the file in Excel â†’ Save As â†’ Choose CSV UTF-8 (Comma delimited) (*.csv).

      2. Re-upload the file to SharePoint/OneDrive and retry the flow.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard