Transform script help... Again. :)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 07:02 AM
Hello again... I need some help because its not my week.
I've written a onBefore script for a transform map to ignore lines with the following conditions
u_compliancestate is not Compliant
Assigned to.active is not false
u_osversion that start with 10.0.1
However I've ran it a few times its no joy... Any thoughts?
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (source.u_compliancestate != 'compliant' && !target.assigned_to.active && !source.u_osversion.startsWith("10.0.1")) {
ignore = true;
}
})(source, map, log, target);
w
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2023 08:06 AM
Hi @Andrew_TND ,
First i would check if condition is satisfied by introducing some log statements inside if block.
like:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (source.u_compliancestate != 'compliant' && !target.assigned_to.active && !source.u_osversion.startsWith("10.0.1")) {
gs.info("Iinside if >>"+" "+source.u_compliancestate+ " "+target.assigned_to.active+" "+source.u_osversion);
ignore = true;
}
})(source, map, log, target);
Accept and hit Helpful if it helps.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025