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.

@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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,173)