Remove "None" option from a choice input in input form screens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 11:55 AM
Hello all,
Do you know if is possible to remove the "None" option from a choice input using the "Input Form Screens" functionality?
Example:
The idea is, initially, to just have all choices as not selected so the user can pick one and not see that an option is already selected like in this case they see "None" option initially being selected.
I've tried to look for an attribute but had no luck with that.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 07:12 AM
Per ServiceNow support ticket, it is working as designed. See the response below:
We are placing it Solution Proposed as we believe the information provided below will resolve your issue. If you have any questions or need anything else related to this Case kindly contact us or update the case and we will be happy to assist you further. If this resolves your issue, please consider closing the Case by clicking on Accept Solution.
Issue:
Question regarding the ability to remove the "--None--" option from a choice input on an input form screen
Solution Proposed:
Unfortunately, there is currently no ability to hide the "--None--" option for choice inputs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 07:49 AM
I found a workaround for this.
Instead of having an input "choice", we changed the input type to "Reference".
So that the choices displayed are referencing the sys choice table, in that way the -none- is not displayed.
This is the configuration for that:
Attributes:
SourceTable: The table where the value will be stored. For example if your intention is to store the value in the State field for Incident, the value would be "incident".
SourceFieldName: The target field, in this case "State".
Conditions: The conditions that will be applied to display the right choices. In this case if we only want to display Incident State choices, the conditions would be like "name=incident^element=state^inactive=false^ORDERBYsequence"
TargetTable: Choice [sys_choice]
As we'll be receive a sys id depending on the choice we select when submitting the screen, in the action item we'll need to implement a script to get the value of the choice to set that value in the field we pointed in the "SourceFieldName" attribute.
Example:
Let's assume we receive the following sys id "3d2fc91d37fa71001dbdd5c543990e83" that corresponds to the following record:
We'll need to query the sys_choice table where sys_id=3d2fc91d37fa71001dbdd5c543990e83 to get the field value for "value". Once we got it we can set the "State" for the incident.