web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse xml power automa...
Power Automate
Answered

Parse xml power automate flow

(0) ShareShare
ReportReport
Posted on by 7

Hello,

 

I have the following XML:

I am trying to create a power automate flow that returns the IdProduct value, if i know the "Code" value.

 

I created a compose action with this code and it worked: 

xpath(xml(outputs('Compose')), 'string(//Product[@Code=''1078'']/@IdProduct)')

 

But i want to create an input (variable,compose) and return it. for example:

xpath(xml(outputs('Compose')), string(concat("//Product[@Code=''", variables('var'), "'']/@IdProduct")))

and i get expression invalid.


Can someone help? thanks.

 

 

<tns:rowset xmlns:tns="http://1.1.1.1/test">
 <tns:row>
 <tns:_xFFFF_xmlresponse><Products NrDoc="68">
<Product IdProduct="1561" Code="1078" Date="2023-03-03 09:57:59.374"/>
<Product IdProduct="1562" Code="1079" Date="2023-03-04 09:57:59.374"/>
</Products></tns:_xFFFF_xmlresponse>
 </tns:row>
</tns:rowset>

 

" 

Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @czx ,

     

    Please try this:

    xpath(xml(outputs('Compose')), concat('string(//Product[@Code=''',variables('var'),''']/@IdProduct)',''))
     
    Best Regards,
    Wearsky

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard