cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vstar19
Post Patron
Post Patron

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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,783)