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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to validate if a f...
Power Automate
Unanswered

how to validate if a field has certain value in all collection Power Automate?

(0) ShareShare
ReportReport
Posted on by

Hi, I'm using microsoft dataverse to connect to my Dynamics 365 trial instance.  and I'm using "List Rows" action.  So I'm looking for a way for do something like value.all(new_status eq 20) then  update related data...

Is there in Power Automate a expression or similar Like .net LINQ Collection.All(predicate)?

AlonsoCotez_0-1618961185622.png

e.g.: List Result =

[

{"name":"foo1", "statuscode":100},

{"name":"foo2", "statuscode":2},

]

now how to validate if all retrieved records the statuscode is 100 in this example the result would be FALSE.

if I use foreach control I don't want to trigger the update action each time per record, just one for hole collection, thanks.

Categories:
I have the same question (0)
  • PrasadAthalye Profile Picture
    on at

    You can use Array filter action.

     

    PrasadAthalye_0-1618964111471.png

     

     

  • Community Power Platform Member Profile Picture
    on at

    Hi, thanks.
    but like the example above,

    [

    {"name":"foo1", "statuscode":100},

    {"name":"foo2", "statuscode":2},

    ]

     

    if i would like to know if all those results(in that example are 2... could be N ) the statuscode is 100, with filter it will just filter 1 record, doesn't it?(it wouldn't tell me if all records met certain condition).

  • PrasadAthalye Profile Picture
    on at

    Filter will give you output of array. You can check the length of an array which will let you know how many records met the condition.

  • Community Power Platform Member Profile Picture
    on at

    Ok got it, basically what I want  to do is "if all retrieved records has an status 100" then update a table if not "do nothing"

     

     should I use foreach control and validate one by one and setting a bool variable like and observer to handler that then validate that variable to continue with the flow.... is that the right way or I'm complicating things?

    Thank you.

     

  • PrasadAthalye Profile Picture
    on at

    Can you please clarify what do you mean "if all retrieved records has an status 100" ...

     

    What do you mean status 100? Are you saying count of all retrieved records equals 100?

  • Community Power Platform Member Profile Picture
    on at

    Hi, yes I mean"if all retrieved records have an status 100"  that collection query a column named statuscode so I need to validate if in that list returned all statuscodes have as value 100 here a representatio e.g.

    [

    {"name":"foo1", "statuscode":100},

    {"name":"foo2", "statuscode":2},

    ]   

    wherever I placed the validation, it would be resolved as false because the returned data has an element with statuscode 2

    [

    {"name":"foo1", "statuscode":100},

    {"name":"foo2", "statuscode":100},

    ] this result would be resolved as true beacuse all elements return have a status 100

    thank you.

     

  • PrasadAthalye Profile Picture
    on at

    I think you will have to use filter condition on list rows to filter all rows where statuscode eq 100. Then run a loop on that collection to fire an update.

     

  • PrasadAthalye Profile Picture
    on at

    @Anonymous did you manage to solve this?

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard