12 Replies · Latest reply on Oct 18, 2017 6:09 PM by harshtimes

    transform script not working

      Hi All,

      I have an integration between Altiris and SN. Altiris leaves an xls and SN reads it.

      One of the columns in the xls contains the AD path of the computer.




      Sometimes will have General and some other times it will have Broadcast as part of the string.

      As part of the transform map i have a transform script that runs: OnBefore


      code as follows:

      (function runTransformScript(source, map, log, target /*undefined onStart*/ ) {



      if (source.u_AD_Path.toLowerCase().indexOf("broadcast") != -1){

          target.u_wspurpose = "broadcast";


      if (source.u_AD_Path.toLowerCase().indexOf("general") != -1){

          target.u_wspurpose = "goffice";



      })(source, map, log, target);


      obviously is not working as expected.


      Other details:

      xls column: AD_Path

      SN field: u_wspurpose

      SN field's values:  Broadcast/broadcast, Gral Office/goffice


      I would like to populate the u_wspurpose field with value broadcast when the string contains "Broadcast", and to populate it with "Gral Office" when the string contains General.


      what am i doing wrong?