Salesforce

How Do I Split a Data Element? (Magic xpi 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Split a Data Element? (Magic xpi 3.x)

To break down a single data element into a multi-occurrence Destination element (the opposite of the unification of data elements procedure), pre-process the Source data in a flow to create flat file data containing the multi-occurrence data. Then map the flat file to the Destination compound to create the required multi-occurrence Destination element.

The solution requires a loop with a variable that controls the number of iterations. You should add elements to the flat file in each iteration by defining the Flat File Destination in Append mode. Alternatively, you can use local ODS arrays.

To split a data element:

  1. Create a Data Mapper step.

  2. Define the Source as XML type and the Destination as a variable. The calculations will be executed on this variable to prevent the repeated reading of the XML for the same data.

  3. Map the element of the Source that holds the alphanumeric value that you want to split into the Alpha variable.

  4. Define a Flow Data step that updates the counter.

  5. Define a new Data Mapper step to handle the split operation. The Source is empty, and the Destination is a Flat File type with Append mode.

  6. Define a Destination expression that extracts the required data, as shown below. For example:

mid ( F.StringToProcess ,F.StartLocation ,F.LineSize )

  1. The final step is a GoTo command for the Calculate (Flow Data) step, with an exit condition (F.Total). In the image below, the Loop exit condition is:

F.LoopCounter < F.Total

Reference
Attachment 
Attachment