Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
stw710
Contributor
Contributor

Create a flat structure in Talend Data Mapper

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?

Labels (3)
5 Replies
Anonymous
Not applicable

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?

stw710
Contributor
Contributor
Author

Not preserving the datatype means: there are "datetime" fields I query from Salesforce, but the structure I got had all fields set to string.

stw710
Contributor
Contributor
Author

The tXMLMap, I have to try it. At first glance I thought it could translate from xml to a flat structure, only. Thanks.

stw710
Contributor
Contributor
Author

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!

Anonymous
Not applicable

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.