web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Viewing a items in a s...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 47

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 

Categories:
  • Verified answer
    Rhiassuring Profile Picture
    8,692 Moderator on at

    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 

  • Steve_Ray74 Profile Picture
    47 on at

    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

     

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    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/

  • Steve_Ray74 Profile Picture
    47 on at

    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

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    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.

  • Steve_Ray74 Profile Picture
    47 on at

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

    Steve_Ray74_0-1651639132559.png

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    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

  • Steve_Ray74 Profile Picture
    47 on at

    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

  • Steve_Ray74 Profile Picture
    47 on at

    Is this correct?

    Steve_Ray74_1-1652054148254.png

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 273 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 235

#3
David_MA Profile Picture

David_MA 172 Super User 2026 Season 2

Last 30 days Overall leaderboard