Hide the Choice on the reference field which should view for old records not for new records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
On a demand form in servicenow,
The 'XXXXX' option is available for selection in the 'Source' dropdown list.
The 'YYYY' option is no longer visible or selectable in the 'Source' dropdown list.
Existing records previously using 'YYYY' remain unchanged, but new records cannot use this option.
Source is on the form which is reference field pointing towards choice list table.
Could anyone please help me these?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Greetings @NITHIN KUMAR1. Is the Source field an out-of-the-box field or is this a custom field? When I signed into my Personal Developer Instance (PDI) I did NOT see an existing field called "Source" on the Demand table. In my example, I am using the out-of-the-box "Portfolio" field.
However, if you are referencing another table, you can utilize a Reference qualifier on the Dictionary entry for the "Source" field. If you are not familiar with navigating to the Dictionary entry to a field, you can right-click the field and select "Configure Dictionary".
Then, once you are in the Dictionary entry for the "Source" field, you can navigate to the "Reference Specification" tab which allows you to pick which table you want to reference. Below the Reference field [table selection], there is the "Use Reference Qualifier" drop-down. You could select "Simple" and use the Condition Builder to filter out the unwanted selections.
If you are NOT using a Reference field and have a String field that has a selection of Choices, you could use an onLoad Client Script that hides the choice you no longer wish to display. This would NOT impact the existing records with that particular choice(s) and would HIDE that choice for future selection. I'll include a link to the Client Script that shows examples of the GlideForm .removeOption method below.
GlideForm (g_form) | ServiceNow Developers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
48m ago
Expected Behavior
Users should be able to see and select YYYY in the Source field dropdown.
Root Cause
The YYYY choice record (used by the Source field) was still present, but it was no longer eligible to appear in the lookup list. This typically happens for one of the following reasons:
✔ Most Common Causes
The YYYY record was set to Active = false
Since the lookup filters out inactive records, the value disappears from the dropdown, but continues to display on historical records.A Reference Qualifier or condition excluded the value
Example: the field has a qualifier likeactive = trueor a script that prevents YYYY from being returned.
A Client Script or UI Policy removed the option
Often this is done using code such as:g_form.removeOption('source', 'YYYY');
Because the record still exists, existing data remains intact, but new records cannot select the value — which matches the observed behavior.