cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
moutinhoabreu
Advocate IV
Advocate IV

Parsing HTTP xml with Xpath, Remove brackets and commas from results

Hi all,

 

Building a flow with a HTTP Soap Call to test specific VAT numbers against VIES European Vat webservice.

I was able to make it run successfully and get a return answer from the webservice.

As soon as i get the reponse from HTTP i performe a COMPOSE action to extract the answer, using Xpath:

 

 

xpath(xml(body('HTTP')), '//*[local-name()="Envelope"]/*[local-name()="Body"]/*[local-name()="checkVatResponse"]/*[local-name()="valid"]/text()')

 

 

It works, in the code above i'm fetching the "valid" field wich returns a true or false.

 

The only problem is the answer is coming with square brackets and commas and i'm no being able to remove it so far:

 

 

[
  "true"
]

 

 

 

In order to pass it to another action i need a simple and clean text: true or false

 

I've saw several threads stating to performe a 2nd compose action using Xpath with a differente parameters, but until now i was nota able to make it work.

 

Does anyone has any idea how to solve it ?

 

appreciated

 

Screenshot 2020-05-17 at 19.22.52.pngScreenshot 2020-05-17 at 19.30.43.pngScreenshot 2020-05-17 at 19.31.02.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @moutinhoabreu ,

 

You could refer to the following methods to extract the value.

  • One method is to use the expression to get the value from the array.

112.PNG

  • Another method is to use Join action to get the value.

113.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

 

Hi @moutinhoabreu ,

 

You could refer to the following methods to extract the value.

  • One method is to use the expression to get the value from the array.

112.PNG

  • Another method is to use Join action to get the value.

113.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the help

it Worked !!!

cheers

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 (2,077)