cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdvantonder
Helper I
Helper I

Multiple Excel tables import to SharePoint list

Hi Community 🙂

I'm trying to run a bulk import from multiple xlsx files in a single SharePoint library into a single SharePoint list.

I started my flow based on a single table (from this post: Excel or CSV to sharepoint list ). I then tried to repeat this flow for multiple Excel files in a SharePoint library.
Here is a high-level view of my flow:

(1) High level flow.PNG

 

I use the 'Send an HTTP request to SharePoint' action to GET all the files in my SharePoint library (there are only .xlsx files).

I then want to append all the files' names into an array variable.

(2) Append array variable.PNG

 The Inputs field in the Compose action is:

outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['d']?['results/Name']

 

My first error is with the 'Append to array variable' action:

"The execution of template action 'Apply_to_each:_Append_file_to_varFilesArray' failed: the result of the evaluation of 'foreach' expression '@outputs('Send_an_HTTP_request_to_SharePoint')?['body']' is of type 'Object'. The result must be a valid array."

 

I have not been able to test the last part of the flow, but it looks like this

Use the array variable (varFilesArray) with all the xlsx file names and repeat the process for each item to take that xlsx file's table (each one called "Table1") and create a SharePoint item for each record in that table. Then the next file's table.

(3) List rows per file.PNG

 

(4) List rows per file.PNG

 

 

Any help will be appreciated, thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
mdvantonder
Helper I
Helper I

Hi @abm, thanks for the suggestion, it probably was something about the Fileuri mapping. In the meanwhile, I used a simpler method that achieved my goal (to add all records from multiple Excel tables into one SharePoint list).

Instead, I used the 'Filter array' action to get all the files from the 'List folder' action. Then for each file 'List rows present in a table' using the File Id from the array. For each value in the table, I then created an item in SharePoint list. Just make sure that the table in all Excel tables are the same, I used 'Table1'.
High-level final 3.png

 

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @mdvantonder 

 

Looks like your fileuri mapping is not quite right. Have a look at the previous step where you getting the fileuri value. See the JSON data. If you need further help please post a sample of your JSON data which contains the fileuri.

 

Thanks



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
Power Automate Video Tutorials
mdvantonder
Helper I
Helper I

Hi @abm, thanks for the suggestion, it probably was something about the Fileuri mapping. In the meanwhile, I used a simpler method that achieved my goal (to add all records from multiple Excel tables into one SharePoint list).

Instead, I used the 'Filter array' action to get all the files from the 'List folder' action. Then for each file 'List rows present in a table' using the File Id from the array. For each value in the table, I then created an item in SharePoint list. Just make sure that the table in all Excel tables are the same, I used 'Table1'.
High-level final 3.png

 

Hi All

I am am trying to do the same thing but when i file is created. I get to the list rows present in a table but i don't get the id option in the files field?

 

am I doing somthing  Wrong?

 

LeonAS_0-1638460322453.png

 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Users online (3,738)