- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 04:33 AM
Hi,
We have 2 different sources which automatically import into the cmdb_ci_computer table. The issue is that i want one to be the primary source and not get overwritten with information from the other if it differs, but want to be able to pick and choose which values it does this for. Lets use "discovery source" as an example. If its discovered with system A, i dont want system B to come in and overwrite it.
Is there a script i can apply to the transform map to ignore a specific value from being imported (not the entire row) if the target field ISNT blank? Or is there a much better way to get this done that im missing?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 06:33 AM
Hi Oliver,
So you want target field to be ignored if target value isn't blank i.e. already populated/present
use following in the transform map onBefore script
if(target.<targetField> == ''){
target.<TargetField> = source.<sourceField>
}
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 06:33 AM
Hi Oliver,
So you want target field to be ignored if target value isn't blank i.e. already populated/present
use following in the transform map onBefore script
if(target.<targetField> == ''){
target.<TargetField> = source.<sourceField>
}
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2023 10:43 AM
If you are using cmdbtransformutil in onbefore script, will it work still?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2019 08:05 AM