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 / Difficulty with modify...
Power Automate
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

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    @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

     

  • Reigningfear Profile Picture
    139 on at

    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

    @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

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard