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

List rows present in a table (Excel): Dynamic Document Library

I'm trying to make a reusable flow that will load data in a given Excel doc into a given SharePoint list based on user inputs (e.g. SharePoint site name, doc library name, etc.). The place that I've come to a grinding halt is working out the Document Library in the List rows present in a table action. Obviously I could manually pick a document library from the drop down, but I want the user to pass this value in as an input so that the flow can be used across SharePoint sites/libraries.

 

I manually added a document library to the field and peeked at the code to see what value is being passed. I've scoured the SharePoint APIs looking for that ID but I cannot find it anywhere.

 

image.png

 

Is there a way to do this? Or is what I'm trying to do impossible?

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the reply. It turns out that this is definitely possible to do...but it's not simple. Here are the steps I took to make the Document Library input dynamic:

 

First, I used the SharePoint Graph api to get the list of document libraries on my site:

image.png

Next I used the Parse JSON action to transform the JSON payload into an array:

image.png

Next, I filtered the array down to the element that contains the doc library the user passed in as an input:

image.png

where From = body('Transform_Drives_List_JSON_to_Array')?['value'] and the left part of the condition = item()['name']

 

Next I set a variable with the Id of the document library:

image.png

where Value = body('Filter_Drives_Array_on_Document_Library')[0]['Id']

 

And finally, I used this document library Id in the Document Library Input in the list rows present in a table action:

image.png

 

And with that my flow ran successfully. A lot of steps, but worth it to make the Document Library input dynamic.

 

P.S. I had to use _api/v2.0/drives because I have multiple document libraries on my site. If I'd only had one library (the default Documents) I could have used _api/v2.0/drive and thus skipped the filter array step to be a hair more efficient. 

View solution in original post

5 REPLIES 5
Super User III
Super User III

Hi @AaronRichardson 

 

Which Power Action step is this? I am looking List Rows present in a table (Excel) connector source which is different than yours? Could you post a screenshot of your design view?

 

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

It's the List rows present in a table (Excel Online Business). Here is the design:image.png

Community Support
Community Support

Hi @AaronRichardson,

 

Unfortunately, Get rows from dynamic Excel file name and table name is impossible, currently Excel connector hasn't supported this Feature, sorry.

This is the similar idea in the IDEA forum, you could head to vote it to make it come true in the future:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Dynamic-content-in-File-amp-Table-inputs-Ex...

 

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.

Thanks for the reply. It turns out that this is definitely possible to do...but it's not simple. Here are the steps I took to make the Document Library input dynamic:

 

First, I used the SharePoint Graph api to get the list of document libraries on my site:

image.png

Next I used the Parse JSON action to transform the JSON payload into an array:

image.png

Next, I filtered the array down to the element that contains the doc library the user passed in as an input:

image.png

where From = body('Transform_Drives_List_JSON_to_Array')?['value'] and the left part of the condition = item()['name']

 

Next I set a variable with the Id of the document library:

image.png

where Value = body('Filter_Drives_Array_on_Document_Library')[0]['Id']

 

And finally, I used this document library Id in the Document Library Input in the list rows present in a table action:

image.png

 

And with that my flow ran successfully. A lot of steps, but worth it to make the Document Library input dynamic.

 

P.S. I had to use _api/v2.0/drives because I have multiple document libraries on my site. If I'd only had one library (the default Documents) I could have used _api/v2.0/drive and thus skipped the filter array step to be a hair more efficient. 

View solution in original post

Hi @AaronRichardson,

 

Thank you for providing this solution, it is complicated but it is worth doing if there is a branch of Excel file need to process. Thanks again for your contribution to community.

 

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.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (11,279)