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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Split - Convert csv to...
Power Automate
Answered

Split - Convert csv to xlsx files

(0) ShareShare
ReportReport
Posted on by 71
 
Hi. I am trying to get the content of this csv file with 10 columns separated by commas as shown in the image above.
 
 
Get file content, has this formula: body('Obter_conteúdo_de_arquivo')?['Content']
Error: Null Content
 
Content By Lines has this formula:  split(outputs('Obter_conteúdo_de_arquivo')?['body'], '\n')
Error: The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Object'.
 
Please could you help me?
I need convert this csv file in xlsx file, but I don't want to copy other people's code on the internet without understanding what's going on, I need to learn.
Categories:
I have the same question (0)
  • LB-04112000-0 Profile Picture
    50 on at
    Try this
     
    split(outputs('Obter_conteúdo_de_arquivo')?['body/Content'], '\n')
     
    Or - you could load the CSV directly into the Excel file...
  • JC-04032021-0 Profile Picture
    71 on at
     
    I received this message error:
    The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'.
     
    If possible to load the CSV directly into the Excel file, it is ok for me. 
     
    I believe you just need to do something similar to Excel's "text to columns" separated by commas.
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,963 Moderator on at
     
    1. You would first need to use string(around the variable/outputs) before you can use split
     
    2. it won't help you because \n won't be seen as a string, its a special character and requires you to use decodeUri
     
    If you truly want to split things on the \n you can use the decodeUri combined with a replace or in the split function
     
    as for the content being null, you would need to use the actual Get Content or Download Attachment or File action to get the physical content
  • JC-04032021-0 Profile Picture
    71 on at
    I managed to solve the null file problem by simply getting the file content and getting that output in a Compose. But I really can't solve the csv formatting. Could you please give me some direction? Attached is the csv with 3 example lines. I really appreciate the help, as I need to solve this problem to continue developing the various steps of this complete solution.
     
  • Michael E. Gernaey Profile Picture
    53,963 Moderator on at
     
    Happy to help but still a little confused. Feel free to treat me like i am 5
     
    Tell me exactly what the issue is, a i am looking at these 3 lines of Excel data and no idea what I am supposed to do with them for you.
     
    then I am happy to show you as I dont see any lines here with \n in them
     
    Also, you are using encode , where i said to use Decode
     
     can you give me the file content that you need Split so that it goes into the excel format so I can white the expression for you
     
    or just share me like 2 lines of it, just enough so i can see the \n etc and then ill split it for you
     
    Feel free to DM me it if you dont want people to see it and i'll remove it after. this is my business, so I am not going to steal your data or use it for anything
     
    Cheer!
  • JC-04032021-0 Profile Picture
    71 on at
    Please consider these 2 files that I have attached now. The csv is the original file and the xlsx is the processed file.
    These 10 columns are fixed in the system.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 464

#2
Haque Profile Picture

Haque 416

#3
David_MA Profile Picture

David_MA 323 Super User 2026 Season 1

Last 30 days Overall leaderboard