How to clear reference field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 06:52 AM - edited 07-29-2024 06:53 AM
Hi All,
in my custom table I want remove reference field value bases on change of choice. kindly let me know how to do it.
I have 2 fields 1 is choice called

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 06:54 AM
Hi there,
Sounds like UI Policy could do this easily. Whats your concern doing this?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 07:03 AM
Hi,
The easiest way of doing this, is to create a onChange Client script that triggers when the field changes, and clears the value of the other field with a script like below:
g_form.clearValue('your_reference_field_name_to_clear');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 07:22 AM
Hi,
below script wan't add anything from reference table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 08:15 AM
Perhaps this helps:
- 2019-07-16 - Article - Clear the field value / Clear the variable value
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field