- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 10:29 PM
Hi community,
I have a requirement here. When the checkbox is checked, the following two variables are visible and mandatory (which can be done by a simple UI policy). Additionally, I have one more requirement: If the first mandatory variable is filled out, the other becomes non-mandatory, and vice versa. Is this achievable? If so, how?
Furthermore, I prefer to avoid creating another UI policy on the same variable that might cause conflicts.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 02:19 AM - edited 04-12-2024 06:24 AM
Hi @Bindhu1,
Hope you are doing well.
Proposed Solution
As a solution, Request you to have a look at the points mentioned below: -
- For your 1st requirement to make both the Fields Mandatory as the Checkbox is marked as Checked, you can write either the Client Script or UI Policy.
- For your 2nd requirement to make the Other Field as Non-Mandatory when the First Field is not Empty or vice-versa, you can write either the Client Script or UI Policy for the same as well.
- If you create another UI Policy on First/Second Variable of Type String, it will not conflict with the first one and If you are not feeling comfortable with UI Policy, you can even go for Client Script as well. It's totally as per your choice. But both will fulfil your requirement.
If you will still face same issue or doubts, you can let me know to implement the same on my Personal Developer Instance that will be helpful for you to get your ask or query solved as soon as possible.
If you find this information/knowledge/solution as helpful, please do not forget to mark the same as Helpful and Accepted as a Solution.
Thanks
Aakash Garg
ServiceNow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 02:19 AM - edited 04-12-2024 06:24 AM
Hi @Bindhu1,
Hope you are doing well.
Proposed Solution
As a solution, Request you to have a look at the points mentioned below: -
- For your 1st requirement to make both the Fields Mandatory as the Checkbox is marked as Checked, you can write either the Client Script or UI Policy.
- For your 2nd requirement to make the Other Field as Non-Mandatory when the First Field is not Empty or vice-versa, you can write either the Client Script or UI Policy for the same as well.
- If you create another UI Policy on First/Second Variable of Type String, it will not conflict with the first one and If you are not feeling comfortable with UI Policy, you can even go for Client Script as well. It's totally as per your choice. But both will fulfil your requirement.
If you will still face same issue or doubts, you can let me know to implement the same on my Personal Developer Instance that will be helpful for you to get your ask or query solved as soon as possible.
If you find this information/knowledge/solution as helpful, please do not forget to mark the same as Helpful and Accepted as a Solution.
Thanks
Aakash Garg
ServiceNow Developer