Transform map script to skip record for null field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2013 09:42 AM
I am importing some software licenses into ServiceNow from another system. I have an import set created that imports the licenses from a spreadsheet. I have one transform map that imports the licenses and another that maps the entitled users. However, not every license has an entitled user while others may have multiples. I would like to create a script on the user transform that looks at the column where the entitled user's display name would be and if that cell is empty, not create an entitlement. Right now it is creating a blank entitlement. I am sure that this is a simple script but I am very new to javascript and I'm having issues getting it right. I will keep researching this and trying to figure it out but if anyone has a way of doing this, please let me know. I know that I can create another data source with only the info that it is looking for but I am trying to avoid the clutter of multiple sources. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2013 10:07 AM
Use an OnBefore tranform script, substitute entitled user's field name for u_user_name
if (source.u_user_name.nil()){
ignore = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2020 10:27 AM
Thanks, It works perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2013 11:50 AM
That seems to have worked perfectly. Thanks for the quick help.