Coalease field script is not working to remove undefined values
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 07:35 PM
Hi All,
I have unique identifier field marked as coalease and now filtering some undefined values from this using below script is giving me the error message like this "Unable to resolve target record, coalesce values not present: [Script]"
(function transformEntry(source) {
if (!source.u_serial_number || source.u_serial_number.toString() === "Undefined") {
ignore = true;
} else {
return source.u_serial_number;
}
})(source);
How to fix this
thank you
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 07:42 PM
Hi @Vamshi_ch123 ,
Did you try with == instead of === operator.
Add gs.log() in If condition and check which part is executing at run time.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2024 08:11 PM
Hi Ashish,
Yes tried as below as well but still getting the same error
(function transformEntry(source) {
if (!source.u_serial_number || source.u_serial_number.toString() == "Undefined") {
ignore = true;
} else {
return source.u_serial_number;
}
})(source);
and without script it is working when i check with single record