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:
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.
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.
Any help will be appreciated, thanks!
Solved! Go to Solution.
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'.
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @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'.
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?
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!
User | Count |
---|---|
33 | |
32 | |
23 | |
22 | |
19 |
User | Count |
---|---|
58 | |
55 | |
41 | |
37 | |
28 |