cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jenor
New Member

Convert csv or textfile to a sharepointist

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Convert csv or textfile to a sharepointist

Hi @Jenor 

 

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


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Convert csv or textfile to a sharepointist

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




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





Super User
Super User

Re: Convert csv or textfile to a sharepointist

Hi @Jenor 

 

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


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Helpful resources

Announcements
Did you attend MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: 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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,007)