Load True/False data using Transform Maps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 09:48 AM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 10:10 AM
var baa = source.u_avmed_baa_ is.toString();
if ( baa =="false" ){
target.u_avmed_baa_is ="false";
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 10:27 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 10:30 AM
Forot to note that I am assuming u_business_associate_agreement is your Import Set table - the temporary table holding your csv data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2016 10:47 AM
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.