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 Automate
Unanswered

Updating a xml file

(0) ShareShare
ReportReport
Posted on by 61

Hello, 

 

I need help with looping through an excel file and updating some values from the excel file to an xml file. 

example : excel file has testdata1, testdata2... etc in column A , I want to loop through this and take each value - testdata1, testdata2 and so on and update to an xml file. 

 

 

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @Sh99 

     

    Could you please share some screenshot of your XML file(any sample) and elaborate your use case with example?

     

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If you can create an XML file template, then I would do that and reference the places to populate with uniquecodes.

    Example XML:

    <FundRelationship_New>

          <ExternalSystemReferenceID>DATA~EXTSYSTEMID</ExternalSystemReferenceID>

          <Entity_Code>DATA~ENTITY</Entity_Code>

          <Sub_entity_Code>DATA~SUBENTITY</Sub_entity_Code>

          <Fund>DATA~FUND</Fund>

          <Class_Code>DATA_CLASS</Class_Code>

    </FundRelationship_New>

     

    Then my Excel data could be:

    EXTSYSTEMID ENTITY SUBENTITY FUND CLASS
    Transaction001 Investor001 Portfolio001 Equity001 ClassA
    Transaction002 Investor002 Portfolio002 Equity002 ClassB
    Transaction003 Investor003 Portfolio003 Equity003 ClassC

     

    PAD could loop through this, replacing text in the template for each DATA~[field].

     

    Good luck!

  • Sh99 Profile Picture
    61 on at

    Hello, 

     

    This is useful, can you share a screenshot of the code while trying to update the data in xml ? I need the screenshot of the xml command . do I use set xml element value?

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    My apolgies, I was going more for a simple "Replace Text" approach, but your way is better, so:

    Read from Excel

    For each row in Excel

        Read XML from file

        Set XML element value

        Set XML element value

        Set XML element value (as many as columns you have)

        Write XML to file (write to a different file, don't mess up your template)

    End for each

    For Set XML element value, mine looks a little difficult, cuz my XPath got messed up by some garbage that was in the way of the normal path:

    MichaelAnnis_0-1714151879730.png


    But there are tools to find your XPath query, or GPT should be able to help get this right.  If you have the paid GPT version, I have a PAD Assistant GPT that I made that might be able to help you.

     

    Regards,

     

    Mike

  • Sh99 Profile Picture
    61 on at

    hello, 

     

    I am not sure what to enter in the xpath query.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    It’s supposed to be parent/child/element, but mine ended being complicated. I would share an example with GPT and ask it what it should be for the element you want to edit. 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 484

#2
11manish Profile Picture

11manish 282

#3
David_MA Profile Picture

David_MA 280 Super User 2026 Season 1

Last 30 days Overall leaderboard