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 / Condition: Array of Ob...
Power Automate
Unanswered

Condition: Array of Objects Contains Field Matching

(0) ShareShare
ReportReport
Posted on by

Hello, I am attepting to write a flow that looks through an Array of Objects and determines if there is a matching value on a certain field. 

 

Here is the structure of my Array of Objects:

 

[
 {
 "id": "ABC",
 "label":"ABC"
 },
 {
 "id": "BCD",
 "label":"BCD"
 },
 {
 "id": "CDE",
 "label":"CDE"
 }
] 

 

Here is the structure I am trying to match against:

 

{
 "id":"ABC"
}

 

 

I want to build a condition such that if the id value is contained within the Array then evaluate true, but if its not contained within the array, evaluate false. 

 

Using the Contains option within the Condition Connector is giving me false values everytime.

 

Categories:
I have the same question (0)
  • Verified answer
    Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    You habe to create a simple array (not a key value pair) to use contains.

     

    But if you only want to check to that single object you could use something like:

     

    equals(item()[‘id’], YOUROBJECT[‘id’])

  • DavidBump Profile Picture
    29 on at
    Since this was a top result in my search for an answer, I thought I'd post an alternative--or an elaboration on the accepted answer for how you would create a simple array of values instead of key:value pairs:
    You could add a Select action, specify your array as the source, and click on the text mode gadget on the right to switch from key:value mode to a single text box, then use the expression:
    item()?['id']
    And add just that to the Map: text field.
    The outputs of that will be:
    [
    "ABC",
    "BCD",
    "CDE"
    ]
    And you can then run contains() on that, or use a condition action with the select as the left side, contains as the operator, and ABC as the value on the right side.

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard