Load True/False data using Transform Maps

matthew_strecke
Kilo Contributor

I have two true/false fields on my csv file that I loaded into the system as a data source. After I map 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 csv file, the true/false fields are in CAPS. This is my script so far and it didn't work,

answer = (function transformEntry(source) {

                      if (u_business_associate_agreement.u_avmed_baa_ == "TRUE") {

                              answer = true;

                      if (u_business_associate_agreement.u_avmed_baa_ == "FALSE") {

                              answer = false;

                              })(source);

u_business_associate_agreement is the source table

u_avmed_baa_ is the field

Would I need answer = false to be pointed to the target table?

12 REPLIES 12

Deepak Kumar5
Kilo Sage

var baa = source.u_avmed_baa_ is.toString();


 


if ( baa =="false" ){


target.u_avmed_baa_is ="false";


};


jayfreise
Mega Contributor

Hi Mathew,


I don't think you need a script to do this. You should be able to just do a direct field-to-field map?


Create a new Field map and select your source and target fields.


Source Table = u_business_associate_agreement


Source Field = u_avmed_baa_


Target Table = {your target table}


Target Field = {your target table's true/false field}


Does this help?


Forot to note that I am assuming u_business_associate_agreement is your Import Set table - the temporary table holding your csv data.


I tried doing it without using a script and I set all of the fields up correctly and mapped the correct variables as well. However, once I ran the transform map and went on the records that were created the true/false fields were not populated correctly. This is why I was thinking a script would help with populating the fields correctly.