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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Exclude items with mul...
Power Automate
Unanswered

Exclude items with multiple entries in SharePoint

(0) ShareShare
ReportReport
Posted on by 14

Hello, I want to create a flow that will exclude items with multiple entries in SharePoint. In the example below, I want to select Jazmin, Nick, and Steve and not Joe as it has multiple items under his name.

 

sample.JPG

Categories:
I have the same question (0)
  • Verified answer
    Caspar_Rubin Profile Picture
    831 on at
    Re: Exclude items with multiple entries in SharePoint

    Hey,

     

    maybe a little complicated but this is how I would do it:

     

    Caspar_Rubin_0-1663165211015.png


    First Part:

     

    Get all items of the list using the Get items action and just point it towards your list.

    Initialize a new variable: An Array variable called Owners, leave its Value empty for the moment.

    Add an Apply to each action and put the value from the Get items action in the * Select an output from previous steps" field.

    Inside the Apply to each, use an Append to array variable action to append the Dynamic content Owned By to the Owners array variable.

    Caspar_Rubin_1-1663165449924.png


    Second Part:

    Use a Compose action with the following Expression, to remove duplicates in your Owners array.

    union(variables('Owners'),variables('Owners'))
     

    Also, Initialize a new Integer variable called Count, set its Value to 0.

     

    Caspar_Rubin_2-1663165639688.png

     

    Third Part:

     

    Use another Apply to each action to loop through the Owners array (Dynamic content "Outputs" from the Union Owners Array action).

    In this Apply to each, make another call to SharePoint using the Get items action, but this time filter it like this:

     

    Make sure item() is an Expression. Also, you have to use the internal name of your SharePoint column OwnerBy... In your case this could be something like "Owned%20By" instead of "OwnedBy"...


    Filter Query: OwnedBy eq 'item()'

    Below that, add another Apply to each and use the value from the above Get items action as it's trigger. Inside it, simply use an Increment variable action to add 1 to the Count variable.

     

    2022-09-14_16h27_57.png

     

    Fourth Part:

    Now for the last part. Use a Condition action outside, below the last Apply to each action and check if Count is less than or equal to than 1

    In the left "If yes" section (green / left) you can now continue building your flow. These are all entries that only occur once in your SharePoint list. 

    Important: Don't forget to add the last Set variable action to reset the Count to 0 at the end but still inside the "Apply to each - Unique Owners" Apply to each action.

     

    2022-09-14_16h42_22.png

     

    When I run the flow, I get this:

     

    Joe goes to the right, Jasmin and the others to the left.

     

    Caspar_Rubin_14-1663166785196.png

     

    cheers

     

     

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard