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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,219)