prevent update of a field in transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 10:10 PM
I have a field "Name" in a CMDB table. This table data is updated through a data source via transform map.
I have a requirement to prevent update of Name through data source when it is manually updated by CMDB admin.
I have written the below logic in OnBefore transform map:
(function runTransformScript(source, map, log, target) {
var grAcc=new GlideRecord('cmdb_ci_computer');
grAcc.addQuery('name','DOES NOT CONTAIN',source.u_name);
grAcc.query();
if(grAcc.next())
ignore=true;
})(source, map, log, target);
With this, not only 'Name' but entire record update is getting skipped, pls let me know how to prevent the update only for "Name" field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 10:17 PM
Hi,
Check the below link that also have same thread you are looking for
Kindly mark it correct and helpful.
Thanks,
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 10:29 PM
Hi,
are you having field map for this field in your transform map? if yes then please remove
If not then check any onBefore transform script is updating the name
Regards
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
04-06-2020 10:45 PM
Yes I am having field map script, it should be there. The above transform script is to check if 'Name' is same as source or not. If it is different then it means the 'Name' is manually updated and it should skip only the 'Name' record update in CMDB, But with my ignore=true; it is skipping the update of other records as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2020 11:19 PM
Hi,
Didn't get the scenario:
Example: if incoming value is IBM-001 and if target record also has name as IBM-001 then what is the issue if the incoming value gets overridden with the same value again
ignore=true will halt the entire row i.e. for all fields.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader