- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 12:16 PM
Hi All,
Setup :
I am using g_form.addOption() in the onLoad Catalog Client Script to populate options in one of my variable. Have written this like:
g_form.addOption('user_department', '1', 'My Department');
Issue :
When viewing this variable at the portal this shows the Label "My Department" as below (Which is as expected):
But when i view this in the created RITM variables it shows its value instead of the Label as :
This behavior is same if i create a request even from the Service Catalog using "Try It" UI Action.
Please suggest the mistake i am doing, if any?
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 01:23 PM
Hi,
(sorry for any duplicate information said, I had this typed like an hour ago, but never clicked submit due to taking a customer call, haha...anyways...)
The options are only being added where you are telling the script to do it.
So in your client script there are checkboxes for "when" it should apply. Catalog Item, Requested Item, Task. If you have it set to only add at one level, but the choice doesn't actually exist in the variable (so hard coded), then it will only show up as a value.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 12:45 PM
Hi,
If you are adding the option on the fly using g_form.addOption, then that option will not be available in the backend. So in the RITM, it will only show the value which was actually stored in the db when the form is submitted.
So add the options in the backend by configuring the variable, then it will be available across the portal.
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 01:23 PM
Hi,
(sorry for any duplicate information said, I had this typed like an hour ago, but never clicked submit due to taking a customer call, haha...anyways...)
The options are only being added where you are telling the script to do it.
So in your client script there are checkboxes for "when" it should apply. Catalog Item, Requested Item, Task. If you have it set to only add at one level, but the choice doesn't actually exist in the variable (so hard coded), then it will only show up as a value.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 11:22 PM
Point on.. Really appreciate that. Thanks.