- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 11:23 PM
This code is perfectly fine on Try it , but doesn't work on service portal
variable 'box' is a checkbox
g_form.setValue('box',true); doesn't work on service portal
I even selected UI type to be 'All' ; but still doesn't work on portal.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2018 12:16 AM
Hi Sonita,
I'm getting the result. I'm using the UI policy. follow the below screenshots it works.
use runscripts in ui policy.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2018 09:10 PM
Even onchange client script also working for me.
use
g_form.setValue('box','true');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2018 09:20 AM
Try using true as a string like 'true' like Rakhy suggests. Servicenow sometime struggles with true/false being a string and not a boolean value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 01:10 PM
You're absolutely right. Unfortunately I can't mark two answers as correct answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 03:22 AM
Hi Sonita,
Any update on this?
Can you mark answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 01:10 PM
g_from.setValue('box','true'); ---> it works as expected