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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Set XML element value

(0) ShareShare
ReportReport
Posted on by

Hi,

 

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

 

radsab_58_0-1650394646072.png

radsab_58_1-1650394682272.png

and the xml code:

 

radsab_58_2-1650394929395.png

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

 

 

 

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

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

     

    https://codebeautify.org/Xpath-Tester

    VJR_0-1650424115891.png

     

     

    Looks like there are some ways to bypass it 

    https://stackoverflow.com/questions/5239685/xml-namespace-breaking-my-xpath

    https://stackoverflow.com/questions/4440451/how-to-ignore-namespaces-with-xpath

     

    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.

  • kinuasa Profile Picture
    795 Most Valuable Professional on at

    Below is a sample using the XPath function.

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

     

  • Community Power Platform Member Profile Picture
    on at

    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.

     

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard