- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2016 04:19 AM
Hi,
Does anyone now how to remove choices from a condition type field using a client script (something similar to g_form.removeOption )?
That way I can present the users with a shorter list of relevant fields and exclude all the others..
thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2016 04:23 AM
Hi Russell,
A quick look through dictionary attributes indicates one called RestrictTo. I haven't used it before, but it looks like it might do what you need. It appears to be some type of redirection (you'll need another field with comma separated field names apparently.) Not sure, as I said, haven't used it before.
Dictionary Attributes - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2016 04:23 AM
Hi Russell,
A quick look through dictionary attributes indicates one called RestrictTo. I haven't used it before, but it looks like it might do what you need. It appears to be some type of redirection (you'll need another field with comma separated field names apparently.) Not sure, as I said, haven't used it before.
Dictionary Attributes - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2016 04:44 AM
Thanks Chuck - that works well using a separate field on the form.
I need to see if I can get it to work with a system property or some other way as I want to put the condition builder field onto a UI Page.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2016 04:53 AM
Glad it worked. Don't forget to mark the original comment correct so others can find it in the future.
Here's a way to use the field in combination with the property. Set the default value of the field to
javascript:gs.getProperty('my.field.list');
Using your property of course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 03:56 AM
HI Chuck,
Can you explain how to use RestrictTo in attribute.
need some example pls