cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndreMostertMM
New Member

How to get data from XML API Request and into PowerApps

Hi all,

 

I have data that is being returned in XML format after making an API request using a Power Automate flow - with guidance from link.

 

API Request Flow.png

 

XPath Response Expression is set to :

xpath(xml(outputs('SET_HTTP_Response')), '/ModuleRequestInvestigateResult')
 
When running my flow I noticed that the XPath Response step receives an empty input - and then output - which I am assuming is because of the expression.
 
API Request Flow Run.png
 
 
 
 
 
 
 
 
 
 
 
 
I would like some assistance in understanding why my expression is receiving and returning an empty value and then how I can access the results using PowerApps.
 
Thank you in advance for any advice
AndreM
1 ACCEPTED SOLUTION

Accepted Solutions

I tried it directly from the source and I clicked on "click to download" both still returned an empty value.

 

I found that my issue was in the xpath() expression not pointing to the correct data. The below works.

 

xpath(xml(outputs('SET_HTTP_Response')),'//*[local-name()="Envelope"]/*[local-name()="Body"]/*[local-name()="ModuleResponse"]/*[local-name()="ModuleResult"]/*[local-name()="ResponseStatus"]/text()')

View solution in original post

2 REPLIES 2
kylzbaba
Resolver I
Resolver I

I see that the compose action to set the xml displays a value. So let's try this, instead of taking output from the "Set Http Response" action card, let's take it directly from the source. xpath(xml(http(body))).

 

Also have you clicked on "click to download" to be sure it doesn't have an output value ? 

I tried it directly from the source and I clicked on "click to download" both still returned an empty value.

 

I found that my issue was in the xpath() expression not pointing to the correct data. The below works.

 

xpath(xml(outputs('SET_HTTP_Response')),'//*[local-name()="Envelope"]/*[local-name()="Body"]/*[local-name()="ModuleResponse"]/*[local-name()="ModuleResult"]/*[local-name()="ResponseStatus"]/text()')

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,381)