I have an xml document which I have imported into a data mapper. However I am trying to get a single structure from this but am not being very successful. Each new records starts on the document tag. Field name is in the following field:-
RA_SURNAME
That value of that field is in the following field:-
Sample
This can be repeated a few times. How would I go about getting a single record out of this please?
I did not try a extract but see what you mean. Until someone more experienced with XML chimes in I did manage to get it right. Just not sure if it is the best way to go about it.
Settings:
Input Data:
XML Elements = /XML/DOCUMENT
Boundaries:
Trigger = On Element
Occurrences = 1
Steps:
I added TPS_VAR_VAL twice to a Extraction.
Therefore got two fields called TPS_VAR_VAL & TPS_VAR_VAL2.
Renamed field TPS_VAR_VAL to Surname and TPS_VAR_VAL2 to Title. (For clarity.)
Selected the Title field in the Fields List of the extraction.
Changed the Title field Based On to JavaScript
Changed the JavaScript to - data.extract(‘./DOCUMENT/VARIABLE[2]/TPS_VAR_VAL’);