How to enter a new line in the XML file

Hi team ,

I want to enter the highlighted 3 lines again below in the xml file .
For eg like this -
image
Please find the original snapshot of the file for your reference.Also I have attached the xml.

MAIN_FILE - Copy.xml (3.7 KB)

Can you please help me in entering the 3 lines ?

Thanks,
gokul

Check if this post it is helping you: How to add dynamique element on existing XML file - #6 by ppr

I tried but I am not able to find the solution.

Regards,
Gokul

@gokul1904
Kindly note that XML Namespaces are to handle:

Let us show some building blocks at some sample data

Variables:

And an initial flow:
grafik

retrieve the element where later to add the new XElements:

xeLineReplacement = xDoc.Root.Descendants(xnsWD + "Invoice_Line_Replacement_Data").First()

Prepare the XElement which is to add:

newXElement = New XElement(xnsWD + "Quantity",1)

Add it:
grafik

Visuals:
grafik

grafik
the element knows its Namespace, but currently is not linked with the wd prefix

After Adding to the existing XML:
grafik

The wd prefix is in use

Afterwards save / process the XML as needed

Find starter Help here:
ppr_XMLWorkdayBox.xaml (8.1 KB)
Data.xml (240 Bytes)

1 Like

Thank you for the help.

Regards,
Gokul

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.