How Do I Extract Specific Data from a Multi-Occurrence Compound? (Magic xpi 4.5)
Use a variable to extract specific data from a multi-occurrence compound and filter it using conditioned mapping.
Sample Schema:
Sample XML Document:
-
Define a variable to hold the extracted data.
-
Drag a Data Mapper utility to the flow area.
-
From the Toolbox's Mapper Schemas section, drag an XML type into the Source area of the Data Mapper window.
-
In the XML Source's Properties pane, select the sample XML document.
-
From the Toolbox's Mapper Schemas section, drag a Variable type into the Destination area of the Data Mapper window.
-
In the Variable Destination's Properties pane, select the variable that you previously defined.
-
In the Data Mapper screen define a single instance filter on the Source’s Person compound with a value of:
Src.S1/Employees/Person/ID ='200'
-
Map the Source Name element to the Destination F.Name variable.
Based on the sample XML document, once the mappings have been executed, the value of the variable F.Name should be Alice.