cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Extract value from an object

Dear all,

 

I am building a flow where I want to extract a specific information from a specific object which is inside an array. So far I have done:

1. Filter the array to only have the object I am interested on. (I used "Filter array" action)

2. Remove all the information of the object except the one I am interested on. (I used "Select" action)

3. I have extracted that object from the array. (I used "First(body('Select'))").

 

Now I have an object as simple as below. BUT I don't know how to extract the value "10" (on this example is 10, but it is a variable and on each run of the flow it will change).

 

 

{
  "ID": "10"
}

 

 

To add more information. I am looking for an specific file on my SharePoint Document Library, using another property of the file to find it (I am using the barcode value, so I'm sure there is only one. This is the information I used on the Filter array action). So, to find and extract this file on flow, I need the ID number. but so far I am locked on the step I mentioned below.

 

I hope someone can support on this.

 

 

Thanks

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
InterestedBloke
Advocate IV
Advocate IV

Hey Barbarur,

It sounds like you're looking for the Parse JSON Action - it'll translate the Object you're getting into specific fields you can target and drop in as dynamic content in other actions after that.

To tell the Parse JSON action how to interpret your object, you can click the Generate Schema button and paste the content you'll get from that object.
It'll then create a schema automatically and translate any future input.

With this, you might even be able to skip some of the filtering actions earlier.

Hope this helps!

View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @Anonymous ,

 

You could store this object in a Compose or an object variable, and then use an expression to extract the value.

If you are using compose, then you can use the following expression:

121.PNG

If you are using variables, then you can use the following expression:

122.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
InterestedBloke
Advocate IV
Advocate IV

Hey Barbarur,

It sounds like you're looking for the Parse JSON Action - it'll translate the Object you're getting into specific fields you can target and drop in as dynamic content in other actions after that.

To tell the Parse JSON action how to interpret your object, you can click the Generate Schema button and paste the content you'll get from that object.
It'll then create a schema automatically and translate any future input.

With this, you might even be able to skip some of the filtering actions earlier.

Hope this helps!

View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @Anonymous ,

 

You could store this object in a Compose or an object variable, and then use an expression to extract the value.

If you are using compose, then you can use the following expression:

121.PNG

If you are using variables, then you can use the following expression:

122.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi InterestedBloke and v-bacao-msft, The three options worked perfectly. Thank you very much!
FreddieV
Resolver I
Resolver I

I am trying to do the same thing, but I am using the outputs from the 'Search user v2' O365 card, but I can't translate this into selecting the individual components of the outputs. Screenshot below:

 

Populated-search.png

 

Does anyone have any ideas about how the expression would look?

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,246)