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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,143)