cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Naps
Helper I
Helper I

Select value from filer array

Hi,

 

I have a filtered array that looks something like this in the output:

 

{

  "name": "john"

  "address": "NY"

  "country": "US"

}

 

From this I want to select only "NY" as I need to compare it to another value.

I tried various expressions etc. but nothing works. Frankly I find the way extracting the data you need is very poorly designed. 

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @Naps,

 

You could use an expression like below to retrieve the address value of the first item of the filtered array:

body('Filter_array')[0]['address']

 

bodyfilterarray.png

ekarim2020
Community Champion
Community Champion

There are a number of ways. If I have the following data in JSON format:

2021-11-12_11-36-09.png

 

2021-11-12_11-37-14.png

I can refer to each property using the following expressions:

outputs('Compose')?['name'] --> john

outputs('Compose')?['address'] --> NY

outputs('Compose')?['country'] --> US

 

As you are using the outputs of the filter array action the steps are going to be similar to the above but different.  This is because the filter array action returns an array as its output:

2021-11-12_11-48-18.png2021-11-12_11-49-12.png

Can you share the flow and some sample data?


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,765)