cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yukonn
Advocate III
Advocate III

Condition for HTTP output

Hi,

 

I created the flow base on HTTP and then response is only XML as below. I want to put the condition after HTTP output and make the another action. But i still cannot find the condition for http output body. I only can see @equals(body('HTTP'), '')

 

Here is my http output body.

 

 

<Soap:Envelope xmlns:Soap="http://schemas.xmlsoap.org/soap/envelope/">
   <Soap:Body>
      <IsNASKeepAlive_Result xmlns="urn:microsoft-dynamics-schemas">
         <return_value>Your return value is here.</return_value>
      </IsNASKeepAlive_Result>
   </Soap:Body>
</Soap:Envelope>  

I want to put the condition like this on condition.

 

 

IF return_value = "" THEN
    'Do something
ELSE
    'Do something

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Chandbhu,

 

        Thanks for your reply. I tried it before i post here. We cannot direcly use body to check for condition. Because retun body has xml format, so that equal function always return false. i used the compose func and check the data. here is my logic for other.

 

Here is code inside compose

 

"@xpath(xml(body('Http')), 'string(/*[name()=\"Soap:Envelope\"]/*[name()=\"Soap:Body\"]/*[name()=\"IsNASKeepAlive_Result\"]/*[name()=\"return_value\"])')"

 

Flow

 

Regards,

View solution in original post

3 REPLIES 3
chandbhu
Power Automate
Power Automate

 

Hi @yukonn,

 

You can try adding condition card like below.

 

 

AddCondition.png

 

 

 

 

 

 

 

 

 

AddCondition2.png

Hi Chandbhu,

 

        Thanks for your reply. I tried it before i post here. We cannot direcly use body to check for condition. Because retun body has xml format, so that equal function always return false. i used the compose func and check the data. here is my logic for other.

 

Here is code inside compose

 

"@xpath(xml(body('Http')), 'string(/*[name()=\"Soap:Envelope\"]/*[name()=\"Soap:Body\"]/*[name()=\"IsNASKeepAlive_Result\"]/*[name()=\"return_value\"])')"

 

Flow

 

Regards,

Meneghino
Community Champion
Community Champion

Hi @yukonn

 

I am having great trouble with XML from this site of the European Central Bank:

http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

 

What is the xPath expression to obtain the date value?

 

I have tried this:

 

xpath(xml(body('HTTP')),'string(gesmes:Envelope/Cube/Cube/@time)')

 

 

But I get this error:

The template language function 'xpath' parameters are invalid: the 'xpath' parameter must be a supported, well formed XPath expression. Please see https://aka.ms/logicexpressions#xpath for usage details.

 

Any ideas?

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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!

Users online (2,211)