Loading data into True/False data types

sigmachiuta
Kilo Guru

I have a data set with True/False data types.   When i export the data from the other system the values are either t or f . not True / False or 1/0.   When I import the data SNow does not recognize that i na True/False field t is true and f is false.   Is there any way to import the values as-is and have the transform understand that if I am entering into a true/false data type that t is true and f is false.   I dont want to change all the values in the import because there are a lot of fields and hundreds of thousnads of rows.

1 ACCEPTED SOLUTION

A before script would definitely work, however I would suggest editing the field map with a script because that way you have all the logic together at the field map level.   Open your existing field map for the true false field and then check the Use source script box and paste in the following:



if (source.field == "t" || source.field == "1") {


    answer = true;



if (source.field == "f" || source.field == "0") {


    answer = false;



These scripts need to have answer="ANSWER", but otherwise they are like any other scripts.


View solution in original post

5 REPLIES 5

ok thanks!