cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
codeninja
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
fchopo
Super User II
Super User II

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
fchopo
Super User II
Super User II

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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,398)