Business rule to restrict approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 04:51 AM
Hi All,
There is a catalog item where once the request is submitted and waiting for approval. there are two check boxes on RITM form where any one should be selected before approving. here is the script
Here the issue is it is working for only one check box the or condition is not working. Please help to achieve this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 07:29 AM
that's what you want.
If any of the checkbox is checked the IF statement will be true and will throw error.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 10:08 AM
I did tried every possible condition, but it is not working as expected. In above script "revoked" option is added first so it is working fine if I check the check box and approve. But if I select the other check box for dates and approve the RITM it is throughing me the error.
My exact ask is user has to check any one of the check boxes before approving. Once selected anyone check box they should be able to approve.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 05:53 AM
Hi @Phanideepthi
I think perhaps just changing the brackets around in the if condition may resolve this:
if ( (ritm.variables.this_variance_is_effective_until_revoked == 'false' || ritm.variables.this_variance_is_effective_within_the_following_duration == 'false') && ritm.cat_item == 'Server Variance')
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 06:57 AM
Hi David,
I did tried the script but not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 07:33 AM
Hi @Phanideepthi
The check box holds a Boolean (true or false) value and the if condition above is checking for the string "false"... so you can do as Anker has stated above and set the variable toString() or remove the quotations from "false" so as to check for a Boolean rather than a string:
e.g. ritm.variables.this_variance_is_effective_until_revoked == false
Something you may have already tried to be fair.