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 / Convert csv or textfil...
Power Automate
Answered

Convert csv or textfile to a sharepointist

(0) ShareShare
ReportReport
Posted on by

Hi All! 

 

I'm a newbie and trying to find out if there is a easy way to convert csv or text file directly to a SharePoint List?

I have been trying to do it from one drive or directly but cant find the way of how, or what step I need to make it work.

Can somebody help me step by step?

 

Thanks alot!

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at
    Hello,

    So did you want the file as an attachment in the SharePoint site in a list.
    Or did you want the file to be uploaded into SharePoint in a Document Library
    Thanks

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Anonymous 

     

    There are no Microsoft CSV reader in Power Automate where you can read & parse all the values from a location. You could achieve this by using lots of string manipulation expressions using flow.

     

    Here is my CSV file (SPList.csv) where each values are comma separated and each lines are separated by enter key (New line).

    1,2,3
    4,5,6
    7,8,9

     

     

    Follow the below steps:

     

    First get the file from OneDrive.

     

    image.png

     

    Next step is get the filecontent

     

    image.png

     

    Next we need to use a Split expression to split each lines. For this we need to declare a variable called EnterKey and under the value just press the enter key.

    image.png

     

    The above split expression is as follows:

    split(outputs('Compose'),variables('EnterKey'))
     
    Next we need to read each lines then split each line values. So split each line  using comma (,) we need another split expression.
     
    So to read each lines we need a foreach loop
    image.png
     
    Above I am using two split statements. 
    First one is as follows. This will split each line values.
    split(items('Apply_to_each'),',')
     
    In my CSV file I only have three values in each line. So the index is going to be like 0, 1, 2
    So to get the first value which is one use the below expression.
    outputs('Compose_3')[0]
    To get the next value use expression
    outputs('Compose_3')[1]
    and so on.
     
    Here are my test results
    image.png
  • Community Power Platform Member Profile Picture
    on at

    @abm's solution is great! This solution helped me with a very similar project. I would only add that in order to add the output values from the .csv or .txt file(s) into a Sharepoint list, it helped me to turn each one into its own variable after I split the comma delimited values (for my project I was able to skip the "Apply to Each" step, since I was only working with 1 row or 1 record of values). 

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard