Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Process Mining
Answered

filter get items by assigned manager and send for approval

(0) ShareShare
ReportReport
Posted on by 105

I have a sharepoint task list, in this list we have manager assignee column, some items have different managers to approve, and some other have the same manager.

in power automate how to filter these items so each manager get ONLY his assigned items in approval details to approve!

 

Thanks, 

Categories:
  • YAYA Profile Picture
    105 on at
    Re: filter get items by assigned manager and send for approval

    @NiloferA thanks, it works 🙂 

  • Verified answer
    NiloferA Profile Picture
    on at
    Re: filter tasks list for each assignee for approval

    Ok, so basically I tried the below approach and it worked for me.

    1. Initialize a String Variable in the beginning of the Flow
    2. In the Apply to each, after Select add Set the Variable action and add the following value
      1.  |Title|Link|
        |-----|-----|
      2. Please make sure to press enter after the second line so that there is a space at the end, this will ensure that the new value is appended at the next line.
      3. NiloferA_0-1620071328476.png

         

    3. Then add another Apply to each and pass Output from Select as Input here.
    4. Within this Apply to each, add Append to String Variable and configure it as below
      1. NiloferA_1-1620071375210.png
      2. First Expression is items('Apply_to_each_2')['Title']

      3. Second Expression is items('Apply_to_each_2')['Link]
      4. Please make sure to press enter after the first line so that there is a space at the end, this will ensure that the new value is appended at the next line.
    5. Then after the Inner Apply to Each action add Start and wait for an Approval Action and pass the string variable in Details.
      1. NiloferA_2-1620071651612.png

    Let me know how this goes for you!

  • YAYA Profile Picture
    105 on at
    Re: filter tasks list for each assignee for approval

    Thank you, this helped me a lot, one issue though! I have done parse JSON after filter array to get the columns that I need to show in approval details and it works BUT when I added the parse json items in the approval details, it put me inside apply to each loop and the approval sent per item, so the assigned manager get his own items one by one instead of get them all in one approval table! 

     

     

     

     

    1.png2.png

  • Verified answer
    NiloferA Profile Picture
    on at
    Re: filter tasks list for each assignee for approval

    @YAYA Oh, I see.

    You can do that as well 😉

    So, lets look at it step by step.

    1. Get all the items from the List
    2. We need to get a list of all the unique managers, so that we can later filter on the items which are assigned to them. To achieve this
      1. Add a Select action, pass value from Get Items and configure it as follows
      2. NiloferA_5-1620054915476.png
      3. Add this expression in value of the Map section- item()['Name of Assignee Field']['DisplayName'] (You can replace DisplayName with Email here as well to make sure we get unique managers later in the process)
      4. Above action will give output of Array with all the Managers in each item in the List. Let's remove the duplicates and get Unique List of Manager
      5. Add a Compose action, and configure it as follows. This will provide an array of Unique Managers.
      6. NiloferA_6-1620055077825.png
    3. Now we need to filter the items assigned to each of these managers. To achieve this
      1. Add an Apply to each action and pass the Output from Compose
      2. Within Apply to each, add Filter Array action and configure it as follows
      3. NiloferA_4-1620054085033.png
      4. In the first textbox, add the following expression - item()['Name of the Assignee Field']['DisplayName'] (OR Email as mentioned previously) and in the second textbox add the following expression - items('Apply_to_each')['Managers']
      5. This will give you an Array with the json objects representing list items assigned to the current manager in the iteration
      6. You will have to add a Select action to select only the fields you want to send in the Approval.
      7. NiloferA_3-1620054058374.png
      8. You will have to apply some formatting depending on how you want the information to be displayed in the Details section of the Approval
      9. Then you can add Start and Wait for Approval action and pass the formatted text in the Details section
    4. Hope this gives you insight on how you can filter items assigned to each Manager in your Task List.

      Please give a Kudo or Mark this Reply as a Solution if you found it helpful.

       

       
  • YAYA Profile Picture
    105 on at
    Re: filter tasks list for each assignee for approval

    Thank you for the reply, actually what I am looking for is in power automate how to filter the items for each assigned manager and put these items in approval details accordingly to approve. so each manager get his items to approve. 

    thanks

  • NiloferA Profile Picture
    on at
    Re: filter tasks list for each assignee for approval

    Hello @YAYA ,

    Do you mean you want to show items where Managers can only see the ones assigned to them in the SharePoint Tasks List?

    If yes, then all you need to do is create a Filtered View by following below steps

    1. Create a View
    2. Give it a name, select the columns you want to show in this View and other settings as you would like
    3. in the Filter Section select Manager Assignee Column, keep the condition as "is equal to" and in the value add [Me]. This View will only show the items assigned to the Logged in User.

    NiloferA_0-1620030627726.png

     

    Hope this answers your question.

    Please give a Kudo or mark this Reply as a Solution if you found it helpful.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Process Mining

Overall leaderboard