Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Set XML element value



When I use set XML element value, I am getting the error "Xpath expression returned no element". Please refer to the screenshots.




and the xml code:



I want to set the value for attribute "Id", but getting the error. Please help.




Super User
Super User

After removing the namespace xmlns it is working so definitely that is obstructing the xpath.




Looks like there are some ways to bypass it


If you are not able to get the right way by doing a web search for this, then you could think of replacing the xmlns with a blank string and then set the new element value and then put back the xmlns. Just a thought.

Resolver I
Resolver I

Below is a sample using the XPath function.

/*[name()='Offering' and namespace-uri()='']/*[name()='OfferInXml']/*[name()='Data']/*[name()='Offer' and namespace-uri()='urn:nms:offer']/*[name()='Metadata']/*[name()='Id']


Hi, It worked! thanks 

and may I know is it possible to get more attributes at once, for example under a particular tag, I need to extract all the tags value.


Helpful resources

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

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