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

Community site session details

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

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:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: Parse xml power automate flow

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard