- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 07:36 AM
I have built a custom Transformation Map for Microsoft Intune Computers. Some of the records coming over have no userPrincipalName and I want to ignore them. After doing some reading on the forum I decided to use an onBefore script to ignore these records. The logic seemed pretty straight forward so I implemented the below:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (source.u_userprincipalname == '') {
ignore = true;
}
})(source, map, log, target);
I ran the import along with the Transform and yet there are records that have no userPrincipalName being updated by the import.
What am I missing?
Thanks,
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 07:42 AM - edited ‎05-19-2023 07:43 AM
Hi @Tom Siegel
Try this
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (source.u_userprincipalname.toString() == '') // check if field name is proper or not.
{
ignore = true;
}
})(source, map, log, target);
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 07:42 AM - edited ‎05-19-2023 07:43 AM
Hi @Tom Siegel
Try this
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (source.u_userprincipalname.toString() == '') // check if field name is proper or not.
{
ignore = true;
}
})(source, map, log, target);
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 09:41 AM
Rohila - Thanks for the help that makes more sense
Tom