Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to create a XML-Document with some nested nodes, so I think the Data Mapper could do the job. My source of data is a single salesforce object, so it is as flat as a usual database table. I would like to create a structure from the schema of a tSalesforceInput. Can anybody help?
As a workaround I wrote the data from tSalesforceInput into a tFileOutputXml and imported that as a structure. This way does not preserve the a simple datatype like date. Is the Data Mapper a good choice to transform a flat structure to a slightly more complex xml document?
Data Mapper is probably overkill here. Why don't you use the tXMLMap for this? I am also not sure what you mean about the tFileOutputXML not preserving the datatype?
Not preserving the datatype means: there are "datetime" fields I query from Salesforce, but the structure I got had all fields set to string.
The tXMLMap, I have to try it. At first glance I thought it could translate from xml to a flat structure, only. Thanks.
tXMLMap works very well for the nested notes! Less funny is it read the structure of an example document and set a node to the correct type "id_date" but dateformat "dd-MM-yyyy". In the example document it is like <creationTimestamp>2021-12-02T09:37:57.065000000+01:00</creationTimestamp>. I have to search the node in job-script to change the format and there is no SimpleDateFormat fitting. java.util.Date sucks!
If you create the XML using the metadata(File XML) you can import the structure and then modify the formats when you look at the metadata created. You can change the date format here and set precision, sizes, etc.