Customer Portal

How to merge two lists or dedup a list string in a reformat

Comments 2

  • Avatar
    Alex Donnelly
    Comment actions Permalink

    Hi Michael,

    Just use Map (former Reformat) component. You can apply transformation similar to this one:

    string []lLicensedStates ;
    string []lLocationStates;

    // Transforms input record into output record.
    function integer transform() {
    //create lists of states from delimited input data
    lLicensedStates = $in.0.LicensedStates.split(";");
    lLocationStates = $in.0.LocationStates.split(";");

    //iterate through LocationStates and check for each state presence in LicensedStates list
    foreach (string state : lLocationStates){
        if (!{

    //convert list ot states into string, use ";" as delimiter
    string CombinedStates = join(";",lLicensedStates);


        return ALL;

    It may not be the best performing way, but if your lists of states consit of only handful items, it will perform OK.

  • Avatar
    Comment actions Permalink

    Thanks Alex.  That worked perfectly. 

Please sign in to leave a comment.