cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tnshr
Regular Visitor

Importing an excel sheet to SharePoint list

Help

I have a flow that uploads an Excel Sheet into a SharePoint document library, then it is supposed to read the file and import the rows in it into a SharePoint list. The excel table has only one column. The filename is unknown at build time, so it is a dynamic field.

Annotation 2020-06-21 212648.png

 

After creating the file as shown in the image I DELAY for about a minute, then I use the "List rows present in a table" action, which calls the file name as given in the "create file" SharePoint action. as shown in screenshot below 

Annotation 2020-06-21 213230.png

However my flow is failing on this stage, as it gives the error below.

 

{
  "status": 400,
  "message": "The parameter 'file' has an invalid value '/CodesUploadTest4.xlsx'."
}

 

 The error as shown below.Annotation 2020-06-21 215729.png

The flow works perfectly fine if I don't use dynamic values for the file name, sadly it is not practical for me to use static names.

How best can I dynamically read an Excel Sheet and add its rows into a SharePoint Online List? I have checked the file names for accuracy, and all looks very correct as far as the values being dynamically passed into the above action. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @tnshr,

 

The file field in the List rows present in a table action should append the file identifier of the new created file, so you should add a Get file properties action after Create file. Then use Get tables action to get table IDs, steps are below:

Annotation 2020-06-22 141400.jpg

 

Annotation 2020-06-22 141409.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

Hi @tnshr,

 

The file field in the List rows present in a table action should append the file identifier of the new created file, so you should add a Get file properties action after Create file. Then use Get tables action to get table IDs, steps are below:

Annotation 2020-06-22 141400.jpg

 

Annotation 2020-06-22 141409.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-litu-msff thank you very much, the solution worked fine.

 

However, it seems to lock the file in SharePoint so that no one can overwrite the file or edit it afterwards.

 

The file https://mytenant.sharepoint.com/sites/SomeSite/VoucherUploads/CodesUploadTest2.xlsx is locked for shared use by me@mytenant.com [membership].
clientRequestId: 626***
serviceRequestId: 626***

 

This error comes up when I try to upload another file with the same file name as my last upload, which I am expecting my users will likely do. Is there a way out of this one, or I have to just make sure all filenames are unique?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,666)