cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vstar19
Helper V
Helper V

Extacting values from a Array variable

Hello,

 

I have initialised a variable to store values. I am storing the values using the Append to Array as below

my-array.png

When I do a compose, the values are out put as 

[
{
"Item Number": "23451",
"Item State": "1"
},
{
"Item Number": "74563",
"Item State": "19"
},
{
"Item Number": "98737",
"Item State": "26"
},
{
"Item Number": "67462",
"Item State": "12"
},
{
"Item Number": "06284",
"Item State": "56"
}
}
]

Now, I need to write a condition to say, 

If Item Number = 98737 {do an action}

 

In the past, I have always written a Flow Expression like - body('NameOfStep')?['value']?['ItemNumber'] 

 

However, this does not appear to work. I believe this is not working because when I appended the items to the array variable, I didn't specify a body. 

 

I'm not sure how its done. 

1. How do I extract just the Item Number from the variable

2. Do I need to construct my append variable to include a body, if so, how is this done?

 

Thank in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
persona
Frequent Visitor

Hi @Vstar19 , I'm a bit new to replying to peoples requests, however, I think I can help.

 

I have created a flow based on what you've given. I get the 5 digit output from the array which can then be used to create a condition in the flow. See what you think. 

 

Picture1.png

View solution in original post

2 REPLIES 2
persona
Frequent Visitor

Hi @Vstar19 , I'm a bit new to replying to peoples requests, however, I think I can help.

 

I have created a flow based on what you've given. I get the 5 digit output from the array which can then be used to create a condition in the flow. See what you think. 

 

Picture1.png

Thanks for your reply. Whilst this will work.... There has to be another way to get the values of the array out of the array variable. 

 

Thank you for your response .I will continue doing some reading, if i cant find anything, i will revert to your solution. 

 

Thanks again. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,072)