cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rajesh
Advocate II
Advocate II

Accessing object property with a specific name

I'm calling an API which returns me an array of products. The sample data looks like this. Each product has a set of properties which are a key value pair

 

{
    "products":[
    {
        "name":"prod1",
        "properties":[
            {
                "name":"prop1",
                "value":"10"
            },
            {
                "name":"prop2",
                "value":"20"
            }
        ]
    },
    {
        "name":"prod2",
        "properties":[
            {
                "name":"prop1",
                "value":"30"
            },
            {
                "name":"prop2",
                "value":"40"
            }
        ]
    }
    ]
}

 

 

The property list is quite big and hence I'm trying to select a few properties that are of interest using the Select data operation. For e.g. Suppose I want to fetch only the product name and the value for the property "prop1". In the select data operation,  I tried something like equals(item()?['properties']?['name'],'prop1')?['value']. However this doesn't work.  Any suggestions please? I thought of using for each loop for product properties, however due to the large no. of products, it isn't an option

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,316)