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 / Insert XML element wit...
Power Automate
Unanswered

Insert XML element with namespace

(0) ShareShare
ReportReport
Posted on by 32

Hi,

I need to dynamically add some elements into existing xml file, but they should contain namespaces.
I'm able to navigate through elements using /*[local-name()='name'] expressions, but I can't figure out how to add new elements.

Here is an example:

<abc:Body>

   <abc:Reports>

      <abc:Summary>
      </abc:Summary>
   </abc:Reports>
</abc:Body>
I need to add the <abc:Summary> element.

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Use insert xml element activity.

     

    Hope this helps,

    Usha.

  • ApoxiomeN Profile Picture
    32 on at

    I didn't specify I was using that action, because I thought it's a given.
    The issue is that PAD is not accepting standard namespace annotation in the 'XML element to insert' field.

  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    I suggest inserting an element with the appropriate namespace and removing the namespace later.


    1. Insert XML element action:

    • XML document: %XmlDocument%
    • XPath query: /*[local-name()='Body']/*[local-name()='Reports']
    • XML element to insert: <abc:Summary xmlns:abc="dummy">hoge</abc:Summary>

    2. Remove XML element attribute action:

    • XML document: %XmlDocument%
    • XPath query: /*[local-name()='Body']/*[local-name()='Reports']/*[local-name()='Summary'][last()]
    • Attribute name: xmlns:abc
  • ApoxiomeN Profile Picture
    32 on at

    this works regarding the insert, but I can't remove the attribute.
    I've tried adding a new attribute and removing that one, that works, so the xpath is correct, but the xmlns:abc stays

  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    When insert an element, how about that specify the same namespace as the root(abc:Body?) element?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard