Need to modify the field script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 12:37 AM
HI Community,
I have written a field script in transform map, when class is t/a/ga/e then it should update as 'e' which is working fine but when there is empty value from source then it should not update as e or ext currently i guess it if the class is empty then it is updating as ext but it should update as empty
How can i modify the script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 12:40 AM
Something like this:
answer = (function transformEntry(source) {
if (source.u_employee_class) {. //when source.u_employee_class is not empty
var zone = source.u_employee_class; // (u_employee_class is the field in source table)
if (zone == "T" || zone == "A" || zone == "GA" || zone == "E") {
return "E";
} else
return 'EXT';
}
})(source);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 01:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 01:26 AM - edited 06-04-2025 01:56 AM
Maybe try:
if (source.u_employee_class.toString()) {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 01:44 AM - edited 06-04-2025 01:45 AM
answer = (function transformEntry(source) {
var zone = source.u_employee_class; // (u_employee_class is the field in source table)
if (zone == "T" || zone == "A" || zone == "GA" || zone == "E") {
return "E";
} else if (zone == " "){
return ' ';
}else
return "EXT";
}
})(source);
HI @sergiu_panaite ,
Can try something like this will it work?