I think this is possible but not sure how to set up. I am using XML pickup. Metadata is asset.
What I want to do is add an extra field (current date and time) and export a brand new XML, identical to the first but with this current data and time field added. How can this be done?
Add a field to an XML file
- magnussandstrom
- Advanced member
- Posts: 358
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Add a field to an XML file
You can do this with the free app 'Create text file'.
Incoming XML:
The Content text in the 'Create text file-app' should be:
Resulting XML:
This approach of course requires the incoming XML to always have the same fields.
Incoming XML:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<job>
<field_A>Hello</field_A>
<field_B>World</field_B>
</job>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<job>
<field_A>[Metadata.Text:Path="/job/field_A",Dataset="Xml",Model="XML"]</field_A>
<field_B>[Metadata.Text:Path="/job/field_B",Dataset="Xml",Model="XML"]</field_B>
<field_C>[Switch.Date:Format="yyyy-MM-dd hh:mm",TimeZone="UTC"]</field_C>
</job>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<job>
<field_A>Hello</field_A>
<field_B>World</field_B>
<field_C>2021-11-03 12:25</field_C>
</job>