- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 10:03 AM
Hello All,
One more little issue, this time with glide list, here is the thing: I need to set a value to a glide list when a boolean field is true but with the examples I've got on ServiceNow Wiki I'm not able to do that, look:
I have these two fields in the user form, "u_ffic_manager" and "u_authorized_approver_for". In the "u_authorized_approver_for" field, I have today only one value (Request):
I'm trying to create a simple script for when the "u_ffic_manager" field is true, the "Request" value is set to "u_authorized_approver_for" field for the specific user, but I'm having no luck on that:
Here is the script:
Any ideas on how to set this?
Thanks!
Milton P. Silva Junior
Solved! Go to Solution.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 11:14 AM
Hi Milton,
You're mixing client and server side code there. If you want to do this as a server side before business rule like your screenshot, you can just do this without g_form as that is a client side method:
if (current.u_ffic_manager == true) {
current.u_authorized_approver_for = "sys_id"; //you could also do current.u_authorized_approver_for.setDisplayValue('Display of the user');
}
If you wanted to do it client side you could put an onchange client script on the ffic manager field and do something like:
if (newValue == 'true') {
g_form.setValue('u_authorized_approver_for', 'sysid');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 11:14 AM
Hi Milton,
You're mixing client and server side code there. If you want to do this as a server side before business rule like your screenshot, you can just do this without g_form as that is a client side method:
if (current.u_ffic_manager == true) {
current.u_authorized_approver_for = "sys_id"; //you could also do current.u_authorized_approver_for.setDisplayValue('Display of the user');
}
If you wanted to do it client side you could put an onchange client script on the ffic manager field and do something like:
if (newValue == 'true') {
g_form.setValue('u_authorized_approver_for', 'sysid');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 11:29 AM
Hi Brad,
Thanks for helping, you are right, my mistake, but even the code you posted apparently is not working, when I save the user form with Business Rule debug enabled, I've got this:
But when I look at the glide list, there is nothing there:
The "Request" option should be there, like this:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 11:31 AM
Make sure it's a before update business rule. Could you post a screenshot of it as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 11:36 AM
You are the man!!! 🙂
I have been using "after" business rule, just changed it to "before" and it is working like a charm!
Thank you so much Brad!