- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 06:13 AM
Hi,
We have created few fields with choices Yes, No and N/A in change request form, so whenever the choice N/A is selected the comment fields should be visible and mandatory. can some one help me how to write one UI policy using script on all those fields.
Thanks,
Bhavani.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 06:21 AM - edited 05-15-2023 06:24 AM
Hi @Bhavani13
In UI Policy conditions tab add the relevant conditions
Add below UI policy action
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 06:21 AM - edited 05-15-2023 06:24 AM
Hi @Bhavani13
In UI Policy conditions tab add the relevant conditions
Add below UI policy action
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 06:22 AM - edited 05-15-2023 06:31 AM
Hi Bhavani,
May I ask why do you want to use Script on UI policy when it can be achieved without scripting as well?
You can create your condition something like this. Instead of No select N/A in options.
Please mark my reply as Helpful and/or Accept Solution, if applicable. Thanks!
Thanks
Jay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 06:24 AM
Hi,
There is a script on the incident table that works similar as your requirement, find it, and make another one using that as a template.
The script on the incident table is called: "Worknotes mandatory onChange of priority"