Load True/False data using Transform Maps

aishwarya53
Kilo Contributor

I have true/false fields on my excel file . After I loaded the data correctly, I run the transform map and the True/False fields are not being populated. I looked online for scripts to help with this problem and I tried a few scripts but nothing works. On the excel file, the true/false fields are yes/no in excel. This is my script so far and it didn't work,

 

answer = (function transformEntry(source) {

 

                      if (source.u_released == "yes") {

 

                              return true;

 

                      if (source.u_released == "no") {

 

                            return false;

 

                              })(source);

 

u_released is  the source field

But on of the resource tells like 

""    source released field equals to the string of yes then mark the Boolean in target field as true ""

But i am not sure what it means. i tried various scripts but still it is show as false 

7 REPLIES 7

No it is not changing 

Tejas Tamboli
Giga Guru

Hello Aishwarya,

 

Did you try like this if not then

You could try something like this:

 

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

 

      var answer = false;

 

      var a = source.u_released;

 

      if (a == "yes") {

              answer = true;

      }

      return answer;

 

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

 

 

You just need to make sure to return the answer.

 

 

I hope this will help you.

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response useful to you and help others to find information faster.

 

Thanks,

Tejas

aishwarya53
Kilo Contributor