Skip to main content

Notifications

Power Automate - General Discussion
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:
  • Steve_Ray74 Profile Picture
    Steve_Ray74 47 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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

  • Rhiassuring Profile Picture
    Rhiassuring 8,688 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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

  • Steve_Ray74 Profile Picture
    Steve_Ray74 47 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    For a specific set of Document Owners.

     

    Thanks

  • Rhiassuring Profile Picture
    Rhiassuring 8,688 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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!

  • Steve_Ray74 Profile Picture
    Steve_Ray74 47 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    Is this correct?

    Steve_Ray74_1-1652054148254.png

     

  • Steve_Ray74 Profile Picture
    Steve_Ray74 47 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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

  • Rhiassuring Profile Picture
    Rhiassuring 8,688 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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
    Steve_Ray74 47 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

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

    Steve_Ray74_0-1651639132559.png

     

  • Rhiassuring Profile Picture
    Rhiassuring 8,688 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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
    Steve_Ray74 47 on at
    Re: Viewing a items in a sharepoint Library in a seperate sharepoint list

    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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard