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

Viewing a items in a sharepoint Library in a seperate sharepoint list

Hi All,

 

The company i work for holds its policies and procedures in a SharePoint Library (there are several thousand). I am reponsible for reviewing and updating approx 800 and am listed as the document owner.

 

My problem is how can i view only the documents i am named docment owner in a list outside of the library where i can assign review tasks to my direct reports so they can review the procedures before they reach there due date?

 

I would to somehow extract the data from the library and sync it to a list on my teams sharepoint site so that the document information changes when the files is updated in the library (the list is essentially a live document). I would then then like to be able to create a flow where i can create a planner task and assign it to a team member before the documents due date is reached?

 

I understand that some or all of this may not be possible.

 

TIA

Steve 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Steve, 

 

All of it is possible. 


However, I'd question the need to store everything in a list outside of the library - you can just create a view where "Document Owner equals [Me]" and bookmark a link to that view, then you'll only see yours - and you can still create a  Planner-task creating flow.  Based on my experience I don't see a need for the list at all.

 

But .. I'll assume for now that you have a reason for wanting this duplication, so I'll go ahead with it.

 

First, here is my demo data. I understand you will have multiple document owners, and the solution I show will still select only yours.  I am just the only person in my tenant. So lonely in here...

 

1) The document library with all the policies in it. DueDate, Document Owner, Name, and Title are all I have here but the number of fields won't matter. 

Rhiassuring_4-1651471489164.png

 

 

2) The list where I want to track my beloved documents. I've made a spot for the name of the document, the due date of review, LibraryID, and the assignee. (RE: Assignee -- I'm going to assume right now that you will manually assign which document goes to which report, in your list; however, this could be automatically done through a matrix - ie, policies that are HR always go through Todd, policies that have the word conduct in them always go through Lucy.. etc.) 

Rhiassuring_14-1651473706562.png

 

This will end up being 3 flows -- your initial flow to populate your list, then the flow that will keep your list in sync with your library, and then the flow that will send out tasks within X days of the due date.

The first flow is quite simple: populate your list with your document information

 

1) Manually trigger a flow

2) Use the "Get files (Properties only)" action, and set the Filter Query to DocumentOwner/Title eq 'Steve Ray'

Rhiassuring_1-1651470773070.png

3) Now we'll add the "Create Item" action, and point it at our list. We'll pop the Dynamic Content from the "Get Files (Properties Only)" output in here - as soon as we do one, it turns into an Apply to Each - which is exactly what we want. 

 

Rhiassuring_5-1651471639719.png

Note: I forgot to show in this screenshot to update your LibraryID field with the ID from the library. This comes in handy later.


After you've put all the dynamic content in however you want it, (assignees will go in manually, after, unless we create a matrix) you're good for this flow. Run it once, it'll build your list, then turn it off. 

 

Here's my now populated list:

Rhiassuring_13-1651473644064.png

 

 

The second flow is: keep your list in sync with the document library.

 

1) Create a flow with the trigger "When an item or a file is modified". 

2) We are going to use trigger conditions on this flow to ensure it only runs if one of our files has been updated, so it doesn't needlessly trigger. Click on the ellipses in the top right hand corner of the trigger action, and click settings. In the "Trigger Conditions", click "Add", and add the following expression:

 

@equals(triggerBody()?['DocumentOwner']?['DisplayName'], 'Steve Ray')

 

Rhiassuring_9-1651472981643.png

 


Of course, replace the field name with your own field name (instead of DocumentOwner.) 

 

3) Use a "Get Items" action to find the appropriate match in your tracking list. I'm using LibraryID eq 'ID' so it will bring back a single entry. 

Rhiassuring_15-1651473766111.png

 

 

3) Use an Update Item action to update your list. We'll use the following expression in the ID slot (all this does is saves us from needing to house an unnecessary loop) - body('Get_items')?['Value']?[0]?['Id'] - and of course, populate your dynamic content fields again so you'll capture the changes. 

 

Rhiassuring_16-1651473891563.png

 

 

NOTE: You could go through a "get changes" on this to identify which fields need to be updated, but, if you don't have zillions, this will work fine.

 

 

The third flow is: send a task to an assignee X days before due date is reached

 

NOTE 1) I am going to assume we want to notify your reports 7 days before the due date.

NOTE 2) Again, this will require that you've manually assigned reports in your list, unless you have a matrix that can be used. 

 

1) Create a scheduled flow that is set to run once every night. 

Rhiassuring_17-1651474070858.png

2) Use the "Get Items" action and the following filter query on your list: DueDate eq addDays(utcNow(),7, 'yyyy-MM-dd')

Rhiassuring_19-1651474521696.png

 

 

This is checking to see - every night - if any due date in the list is equal to 7 days in the future. 

 

3) Let's use a Condition now so we can end the flow gracefully if nothing fits the criteria. In the left side, we'll enter this expression: length(outputs('Get_items')?['body/value'])   - this is counting the number of items we've returned. The other side of our condition is "is greater than or equal to" "1". 

Rhiassuring_20-1651474760179.png

 

4) On our "No" side, we can leave it empty. But on our "Yes" side, let's use a "Get Item" action to make this a bit easier for you. We'll reuse our expression from before to get the ID: body('Get_items')?['Value']?[0]?['Id'] - this is just going to make it easier to plop in all of your Dynamic Content to the task.  

Rhiassuring_0-1651475820326.png

 

5) Next, we want to create a planner task. We will use the "Create a Task" action. In both of the expressions you see here, we are just formatting the date time to dd-MM-yyyy so Planner will accept it. In the "Start Date Time" i'm using UTCNow(), and in the Due Date Time I'm using "DueDate" 

  

Rhiassuring_1-1651475839973.png

 

6) And, finally, if you want to add details to the task -- you need to use the action called "Update Task Details". You refer back to the task you've created, and then the rest is pretty self explanatory. This is how you can add references, task description, or a checklist. 

 

Rhiassuring_2-1651475857883.png

 

  

Here's how the task has come through for me:  

  

Rhiassuring_3-1651475869834.png

 

 

So .. there's the full thing. I kind of question some of the steps in here, I think if it were me, I'd have an approver matrix list, no secondary list, and I'd probably use Approval tasks and have a log somewhere. But! I don't know your full requirements.

 

Cheers, 

 

Rhia 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



View solution in original post

13 REPLIES 13

Hi Steve, 

 

All of it is possible. 


However, I'd question the need to store everything in a list outside of the library - you can just create a view where "Document Owner equals [Me]" and bookmark a link to that view, then you'll only see yours - and you can still create a  Planner-task creating flow.  Based on my experience I don't see a need for the list at all.

 

But .. I'll assume for now that you have a reason for wanting this duplication, so I'll go ahead with it.

 

First, here is my demo data. I understand you will have multiple document owners, and the solution I show will still select only yours.  I am just the only person in my tenant. So lonely in here...

 

1) The document library with all the policies in it. DueDate, Document Owner, Name, and Title are all I have here but the number of fields won't matter. 

Rhiassuring_4-1651471489164.png

 

 

2) The list where I want to track my beloved documents. I've made a spot for the name of the document, the due date of review, LibraryID, and the assignee. (RE: Assignee -- I'm going to assume right now that you will manually assign which document goes to which report, in your list; however, this could be automatically done through a matrix - ie, policies that are HR always go through Todd, policies that have the word conduct in them always go through Lucy.. etc.) 

Rhiassuring_14-1651473706562.png

 

This will end up being 3 flows -- your initial flow to populate your list, then the flow that will keep your list in sync with your library, and then the flow that will send out tasks within X days of the due date.

The first flow is quite simple: populate your list with your document information

 

1) Manually trigger a flow

2) Use the "Get files (Properties only)" action, and set the Filter Query to DocumentOwner/Title eq 'Steve Ray'

Rhiassuring_1-1651470773070.png

3) Now we'll add the "Create Item" action, and point it at our list. We'll pop the Dynamic Content from the "Get Files (Properties Only)" output in here - as soon as we do one, it turns into an Apply to Each - which is exactly what we want. 

 

Rhiassuring_5-1651471639719.png

Note: I forgot to show in this screenshot to update your LibraryID field with the ID from the library. This comes in handy later.


After you've put all the dynamic content in however you want it, (assignees will go in manually, after, unless we create a matrix) you're good for this flow. Run it once, it'll build your list, then turn it off. 

 

Here's my now populated list:

Rhiassuring_13-1651473644064.png

 

 

The second flow is: keep your list in sync with the document library.

 

1) Create a flow with the trigger "When an item or a file is modified". 

2) We are going to use trigger conditions on this flow to ensure it only runs if one of our files has been updated, so it doesn't needlessly trigger. Click on the ellipses in the top right hand corner of the trigger action, and click settings. In the "Trigger Conditions", click "Add", and add the following expression:

 

@equals(triggerBody()?['DocumentOwner']?['DisplayName'], 'Steve Ray')

 

Rhiassuring_9-1651472981643.png

 


Of course, replace the field name with your own field name (instead of DocumentOwner.) 

 

3) Use a "Get Items" action to find the appropriate match in your tracking list. I'm using LibraryID eq 'ID' so it will bring back a single entry. 

Rhiassuring_15-1651473766111.png

 

 

3) Use an Update Item action to update your list. We'll use the following expression in the ID slot (all this does is saves us from needing to house an unnecessary loop) - body('Get_items')?['Value']?[0]?['Id'] - and of course, populate your dynamic content fields again so you'll capture the changes. 

 

Rhiassuring_16-1651473891563.png

 

 

NOTE: You could go through a "get changes" on this to identify which fields need to be updated, but, if you don't have zillions, this will work fine.

 

 

The third flow is: send a task to an assignee X days before due date is reached

 

NOTE 1) I am going to assume we want to notify your reports 7 days before the due date.

NOTE 2) Again, this will require that you've manually assigned reports in your list, unless you have a matrix that can be used. 

 

1) Create a scheduled flow that is set to run once every night. 

Rhiassuring_17-1651474070858.png

2) Use the "Get Items" action and the following filter query on your list: DueDate eq addDays(utcNow(),7, 'yyyy-MM-dd')

Rhiassuring_19-1651474521696.png

 

 

This is checking to see - every night - if any due date in the list is equal to 7 days in the future. 

 

3) Let's use a Condition now so we can end the flow gracefully if nothing fits the criteria. In the left side, we'll enter this expression: length(outputs('Get_items')?['body/value'])   - this is counting the number of items we've returned. The other side of our condition is "is greater than or equal to" "1". 

Rhiassuring_20-1651474760179.png

 

4) On our "No" side, we can leave it empty. But on our "Yes" side, let's use a "Get Item" action to make this a bit easier for you. We'll reuse our expression from before to get the ID: body('Get_items')?['Value']?[0]?['Id'] - this is just going to make it easier to plop in all of your Dynamic Content to the task.  

Rhiassuring_0-1651475820326.png

 

5) Next, we want to create a planner task. We will use the "Create a Task" action. In both of the expressions you see here, we are just formatting the date time to dd-MM-yyyy so Planner will accept it. In the "Start Date Time" i'm using UTCNow(), and in the Due Date Time I'm using "DueDate" 

  

Rhiassuring_1-1651475839973.png

 

6) And, finally, if you want to add details to the task -- you need to use the action called "Update Task Details". You refer back to the task you've created, and then the rest is pretty self explanatory. This is how you can add references, task description, or a checklist. 

 

Rhiassuring_2-1651475857883.png

 

  

Here's how the task has come through for me:  

  

Rhiassuring_3-1651475869834.png

 

 

So .. there's the full thing. I kind of question some of the steps in here, I think if it were me, I'd have an approver matrix list, no secondary list, and I'd probably use Approval tasks and have a log somewhere. But! I don't know your full requirements.

 

Cheers, 

 

Rhia 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi @Rhiassuring,

 

I am working through the first flow and it runs successfully however it only seems to be adding 100 lines to the list? There should be over 700 items in the list. Is this a limit setting in the flow or the sharepoint list?

Steve_Ray74_0-1651544794781.png

Thanks

 

Steve

 

 

There is a limit but you can avoid it - check out this post: https://blog.sommerfeldsven.de/microsoft-flow-delete-more-than-100-rows-of-a-sharepoint-list/

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi @Rhiassuring 

 

I have got the 1st flow working thanks heaps for your assistacne.

 

I am now looking at the second flow and had a thought? What if a new document is loaded to the document library (a new line would need to be added to my list) or a document deleted (an exisitng line would nees to be deleted from my list)? I'm assuming these would need to be a seperate flows?

 

Thanks Again

 

Steve

Yes, if new docs will be created, we need to catch those & add them to your list!

 

Easy update: on Flow #2, just use the "When a file or item is created or modified" instead of one that's just modified. The only other amendment would be to put a "Condition" action right after your Get Item. In the condition, put in an expression: length(body-of-your-Get-Item-here). Then "is greater than or equal to" and "1". On the "No" side, you'll "Create Item" in your list; in the "Yes" side, you'll continue the rest of the flow as described.

If a document is deleted - yes, you'd need another flow, as you'd need to use the "When a document is deleted" flow. The good news is that it will be almost identical to your Flow #2, except instead of updating it in the "Yes" path, you're deleting it in the "Yes" path. The No path would be empty. The difference is that we won't be able to trigger on the metadata (ie, only run when you're the document owner) .. because that's been deleted. So it will run every time, for every deletion.

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Is this expression coeect of should there be something inside the brackets?

Steve_Ray74_0-1651639132559.png

 

length() should have your "Get Items" output in it - click between the parenthesis and then click on the dynamic output for body from Get Items. 

And for the 1 - it doesn't need quotation marks, sorry, should've clarified.


R

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi @Rhiassuring 

Thanks for all you help so far, i do have another question though?

 

How do i write the trigger conditions if i wanted to include more document owners?

 

Steve_Ray74_0-1652054072799.png

Thanks

 

Steve

Is this correct?

Steve_Ray74_1-1652054148254.png

 

For your first question: Are you wanting to run this for any item that has a populated Document Owner? Or for only a specific set of Document Owners?

For your second question: Yep, that's right!

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



For a specific set of Document Owners.

 

Thanks

You can create an "OR" statement in the trigger condition like this.

 

@Anonymous(equals(triggerBody()?['DocumentOwner']?['DisplayName'], 'Steve Ray'), equals(triggerBody()?['DocumentOwner']?['DisplayName'], 'Rhia Wieclawek'), equals(triggerBody()?['DocumentOwner']?['DisplayName'], 'Scrooge McDuck'))

All it is, is @Anonymous(equals(condition),equals(condition),equals(condition)) 

Now, I don't know how many of those Power Automate will tolerate in a trigger. I'm surprised it let me do 3, but I tested, and it works. 

If you have many, and this is a huge pain in rear, then you could also evaluate after the flow kicks off - the downside is this means the flow will trigger every time something is edited, but, your condition will say "hey, is this person in this grouping of document owners we have?" and then terminate the flow if not. Let me know if this is more appropriate to your needs (ie, if you have more than 4 or 5 doc owners to track.) 

R

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi @Rhiassuring 

 

This is awesome thanks so much.

 

I am still working through how many document owners i need to track as now i've mentioned this to my peers the scope keeps expanding!!

 

If you are able to provide an example for if i have say 5 or more i would be extremely grateful😀

 

Thanks Again

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (896)