[XML Records] Updating Fields in XML file

[XML Records] Updating Fields in XML file

  
Forge Component
(23)
Published on 15 Jun by Ricardo Silva
23 votes
Published on 15 Jun by Ricardo Silva

Hi,

How I can update below XML fields using XML Record Extension --

<?xml version="1.0" encoding="utf-8"?>
<DBExport>
  <Entity name="SaveRadioButton">
    <Attribute>
      <Name>Id</Name>
      <Value>0</Value>
    </Attribute>
    <Attribute>
      <Name>YesNoUnkownId</Name>
      <Value>0</Value>
    </Attribute>
    <Attribute>
      <Name>YesNoUnkownId2</Name>
      <Value>0</Value>
    </Attribute>
    <Attribute>
      <Name>YesNoUnkownId3</Name>
      <Value>0</Value>
    </Attribute>
    <Attribute>
      <Name>YesNoUnkownId4</Name>
      <Value>0</Value>
    </Attribute>
    <Attribute>
      <Name>YesNoUnkownId5</Name>
      <Value>0</Value>
    </Attribute>
  </Entity>
</DBExport>


I want to update  value from 0 to 1 --

<Attribute>
      <Name>YesNoUnkownId</Name>
      <Value>1</Value>
    </Attribute>


Thanks

Hi Rohit,

Its very simple, convert your xml into record list and update the record list using loop and again convert your

record list into xml and use it.

Thanks,

Manish Jawla

Actually I don't want to convert the file into record while adding data, as XML will be dynamic.


What I am trying to achieve --

I'm passing Entity as a XML, and column name which I want to update from Web Screen to a web block where based column I want to update the value of the column.

Hi Rohit,

In that case you can also use Regex_Replace() method and replaces all the occurrence of 0 to 1.

Thanks,

Manish Jawla