Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Difficulty with modifying list based on multiple Variables

(0) ShareShare
ReportReport
Posted on by 139

Good morning,

 

I am seeking guidance on building a flow that modifies one of my lists in SharePoint. Essentially, I have a list of items which need to be reviewed by individuals that is being tracked in another list. I've been able to develop a flow that automatically assigns a set number of items (through manual input) to each reviewer in the list. The troublesome part for me now is I now need to assign only 50% of the items, based on the creator of the item (specialist) as well as another variable, the 'code'. Below is my flow currently which is functional but I am not sure how to assign only 50% of the items, based on the person as well as the code. I've tried to use variables to store the count of items, the person and the code but the assignment part is eluding me. 

 

Any help is appreciated. 

 

 Current Assignment flow.PNG

  • efialttes Profile Picture
    14,756 on at
    Re: Difficulty with modifying list based on multiple Variables

    @Reigningfear 

    You are right, sorry for the two mistakes!

    ['value'] was missing, and I should have used take() instead of first()

     

    Try with the following instead

     

    take(body('Get_items_from_COMs_for_Review_-_Findings_Tracker')?['value'],div(length(body('Get_items_from_COMs_for_Review_-_Findings_Tracker')?['value']),2))

     

    In ths following image I am using a "Get items" action block with its default name

     

    flow_50_percent_3.png

     

    Hope this helps

     

  • Reigningfear Profile Picture
    139 on at
    Re: Difficulty with modifying list based on multiple Variables

    Hello @efialttes ,

     

    I really appreciate the response. I attempted to apply your solution and it seems to be differnet when using get items. For example, I receive this error when directly applying your solution:

     

    first(body('Get_items_from_COMs_for_Review_-_Findings_Tracker'),div(length(body('Get_items_from_COMs_for_Review_-_Findings_Tracker')),2))

    When Applying logic directlyWhen Applying logic directlyAttempt at modifying expression to take in an array.Attempt at modifying expression to take in an array.

    first(body('Get_items_from_COMs_for_Review_-_Findings_Tracker')?['value'],div(length(body('Get_items_from_COMs_for_Review_-_Findings_Tracker')?['value']),2))

     

     

    I suspect the second one has something to do with the fact that the values dynamic content has an extra paren? zi am not sure. I've attempted to rearrange the parens in different ways but it keeps providing this error. 

     

     

  • efialttes Profile Picture
    14,756 on at
    Re: Difficulty with modifying list based on multiple Variables

    @Reigningfear 

    What I understand is that the list of items is stored in this array, right?

    flow_50_percent.png

    ...and you need to work with a 50% of its items, right?

    A very simple approach is to calculate array's length (N), divide it by 2 (N/2), and get the first (N/2) items from this array as the input for your Apply_to_each loop.

    This can be done by means of variables and expressions. So you can use a "Initialize variable" action block, assign it a name, select as type "array", and use the following expression as value:

    flow_50_percent_2.png

     

    Please note in my example I am using as an input array the result of a "Get items (properties only)" action block; I guess in your project your are using a "Get items".

    Hope this helps

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492