[Javascript]Handle Multi-Data In Field

This recipe shows how to handle multi-data in the fields using javascript in a composite datasource.

Steps taken:

  1. Create a composite datasource (compositeTest.ds). Drag and drop the tabuar datasource (Test.ds) as the beginning of the flow.
  2. Add a “Processor” element following the tabular datasource. Select “General > JavaScript”. Enter the following script into the “processRecord” tab:importScript("/Elixir/ER_Cookbook/Data-Designer/DS-Composite/Processor/JavaScript/HandlingMultiDataInField/resource/Tokenizer.js")
    var tokens = Field2.tokenize("|", “”, true);
    {
    var out = this.newRecordInstance();
    var outData = out.getData();
    outData[0] = Field1;
    outData[1] = tokens[1];
    outData[2] = tokens[2];
    next.processRecord(out);
    }

To download the necessary files for this recipe, refer to the attached ZIP package.
HandlingMultiDataInField.zip