cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mr-samd
Helper II
Helper II

Is it possible to reference a document library in a list so i can use the data in a flow?

Hi,

 

I am pretty new to SharePoint and flows.

I have a document library with Risk assessments in which has a column for when they need to be reviewed.

I want to set up a flow to get an automatic email when it reaches this date (or preferably 2 weeks before).

 

From what I can gather, you cant use document libraries in flows, only lists (correct me if im wrong) so I was wondering if I could make a list that references the column in the document library. That way I could set up the flow from the list but with the data from the document library.

Any other workarounds are welcome.

 

Thanks

Sam

1 ACCEPTED SOLUTION

Accepted Solutions
RobElliott
Super User
Super User

@mr-samd an example of a reminder  flow for a document library item is as follows:
0-trigger-getItems-compose.png

 

1-compose-condition.png

 

2-greenChannel.png

 

3-emailResult.png

 

0a-getDocumentLibrary.png

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

14 REPLIES 14
RobElliott
Super User
Super User

@mr-samd you CAN use document libraries in your flows, you just have to type them as a custom value in the list dropdown.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

Oh ok thanks @RobElliott , What format would that be in? (e.g. the URL?)

RobElliott
Super User
Super User

@mr-samd an example of a reminder  flow for a document library item is as follows:
0-trigger-getItems-compose.png

 

1-compose-condition.png

 

2-greenChannel.png

 

3-emailResult.png

 

0a-getDocumentLibrary.png

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

You asked: "What format would that be in? (e.g. the URL?)". You don't type in a url, at the bottom of the dropdown click on Enter custom value then type in the name of the document library. It will find it with no problem.

0b-customValue.png

Rob

Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks. 

efialttes
Super User III
Super User III

Hi

You can implement sucha a Power Automate Flow with a document library also, assuming the Date you want to evaluate is stored in a metadata column, just the same as if it was a List item

 

So you need:

-A daily recurrence trigger

-A SP 'Get files' action block.

In order to filter the contents of the list, there are different techniques:

-An 'Apply to each' with a Condition action block inside, taking 'Get items' output as 'Apply to Each' input

-A 'Filter Array' action block, then an Apply to Each taking Filter Array output as 'Apply to Each' input

-Filter ODATA query in the Get Items action block, then an Apply to Each taking 'Get items' output as 'Apply to Each' input

 

Assuming you are using 'Created' column that is a standard in a SP list, and you want to identify items with 'Created value' older than 7 days from todaya possible approach is the following Filter Array expression:

 

@less(item()?['Created'], addDays(utcnow(), -7))

 

IN the following screenshot you will see the secuence of actions after trigger Recurrence, please not the expression of Filter Array is more complex in my example than the one you need, but the steps should be the same for you

 

Flow_FilterSP.png

Inside your Apply to each, just invoke whatever logic you need, the loop will iterate through all items matching your Filter Array condition

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



@RobElliott  Once you start typing the document library in the custom value box is it supposed to give a drop down as there is no prompt that what I am typing is doing anything. It doesn't seem to have the column options in later dynamic content either.

No it just give you a dropdown, just type in the name! It will give you the columns in the dynamic content for later actions as I showed in my screenshots.

Rob
Los Gallardos

@RobElliott Ok I have the document library working. Looking at the rest of the flow I Can find a Compose module but not a 'Compose Today/Next review/review date/ect' are they ones you named?

I wont let me add the formatDateTime into the standard 'compose' box.

 

Sorry for all the questions

@mr-samd it is always good practice to rename actions. I mainly do this for Compose actions so I know what each one is doing. You rename an action by clicking on the 3 dots at the top right and selecting Rename. That is what I have done with those Compose actions.

You don't add the format into the box directly. Click in the Inputs box then select the Expression tab in the dynamic content box and enter the expression there then click OK.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

@RobElliott  I did this and it gave me this error...Capture.PNG

 

Looking at your screenshot you haven't added the full expression for the format DateTime. You need to include what data to format. So if you are wanting to get today's date in a particular format - the US one is necessary for date comparisons as you are doing here - then you'd use formatDateTime(utcNow(),'yyyy-MM-dd')

Rob
Los Gallardos

@RobElliott That makes sense. Can I ask what the 'Compose_ReviewDate' is referencing as I am getting errors that it needs a valid reference and I assume this is a place holder?

The Compose FormatReviewDate is just formatting the Compose ReviewDate into yyyy-MM-ddd format so that it can be compared with the Compose Today.  If you look at the comment I've added to each compose with the syntax you'll can see what it's doing.

Rob
Los Gallardos

Ok I think that's is sorted. just need to test it all now. Thanks for all of your help @RobElliott !!!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (27,157)