how to change value of reference field from some value to blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 06:47 AM
Hi ,
I am trying to populate a reference field from transform map using field map script. I need to clear out this reference field value sometimes, through field script. so i have given value ='NULL' in the else condition of script.. but it is creating below problems
1. first of all it was not clearing the field value at all.
2. when i have created a null value in the referenced table, then it is clearing field value but it is not making it null, means in the filter it is showing it has empty value, but i want to make this value as blank.
here is my questing is it possible to make reference field value as blank? or
To change reference field value to blank always we need to create an empty field in referenced table?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 10:57 PM
Hi Deepak,
This update is working from background script and fix script but it's not working in transform map field map script..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 11:25 PM
Deactivating "Run business rule" in transform map is not working.
scenario is that I have created below script to update user name in managed by field of business service table. once name has been populated ,if condition doesn't match ,then that value from managed by field should be removed when next time integration runs.
I have tried this script , even i tried target.field ='' ; too , but that too isn't working.
but when i tried below script with creating an empty user in user table , field is clearing it's value. but field value is not null, field is having an empty value.
value of that field is displaying like below screen shot:
if it null value then it should not have any sys id.
but managed by is referencing to empty value in user table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 12:18 AM
Can you confirm that line of code is even being executed?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 06:53 AM
You can remove the Field from Mapping and use the Script instead.
If match your condition then update the record else leave it.Remove your else condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 06:56 AM
I need else condition because if else condition matches then only i need to clear the field value...