cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Flow Condition - Check if HTTP body contain a certain value

Greetings

 

I have a flow which runs a HTTP GET request. This will return a body with an empty value array, or an value array with some data.

 

I want to run a condition to check if there is any data in the array.
Currently I tried to configure the condition to see if Body "contains" the value Phone. I also tried to set value as *Phone*:

 

codeninja_0-1601050424797.png

 

I expected this to return true, as the body in this case has an array where there is a Phone property, but it returns false.

 

Any tips to how I can check this?

Here are two example bodies, one that contain data and one that doesn´t.

 

This should return true:

{
"@odata.context": "https://test.com/result",
"value": [
{
"Name": "Name name",
"Phone": "1234567",


}
]
}

 

 

and this should return false:

{
"@odata.context": "https://test.com/result",
"value": []
}

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Flow Condition - Check if HTTP body contain a certain value

Hello @codeninja 

I think this is because the "Phone" field is inside "value". Please, try the following expression on the left side of the condition:

body('http')?['value']

 Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: Flow Condition - Check if HTTP body contain a certain value

Hello @codeninja 

I think this is because the "Phone" field is inside "value". Please, try the following expression on the left side of the condition:

body('http')?['value']

 Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

Highlighted
Super User
Super User

Re: Flow Condition - Check if HTTP body contain a certain value

Hi @codeninja 

Since the value is an array, in the condition just check the length of the array is greater than 0 and then implement your logic.

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (8,852)