- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2016 04:34 AM
Hi All,
I am very new to Service Now and using REST API. I am trying to update a particular field in the target table to null (e.g. : email), but it is not getting set. The problem is that I am sending only some columns in the REST request and other fields are not sent. If I want to set any field as NULL or empty than the request is ignored. I enabled 'Copy empty fields' in the transform map but if the request does not contain all the fields, then the fields which are not sent in the request are set as empty. I tried using scripts but I wasn't successful and I think the values should be handled before they are inserted in the import table (I am likely to be wrong). Any help is highly appreciated as this issue is very urgent.
I went through this link How to clear out the field on target table via Web Service + Transform Map
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2016 06:01 AM
I am using onBefore script type and setting target value , instead I should have set source value. Changing that solved the problem. Thanks for all your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2016 04:46 AM
Hi,
Could you please share the script details that did not work?
Thanks
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2016 04:51 AM
Hi Srinivas,
Unfortunately I deleted the scripts, but I was trying to get the values of all the fields that were present in the map using source, which I realized wouldn't work. I was expecting the source.fieldname to fetch me a NULL value if it was not passed in the REST request. I was using onBefore script
I appreciate the quick response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2016 09:04 PM
Can anyone please guide me as to whether writing scripts for transform map will solve this issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2016 09:08 PM
Hi,
You can set answer = ' ';