select box - multiple choice - g_form.addOption

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2019 02:26 AM
Hi,
I have a catalog item where one of the variables (it is part of a variable set) will display all assets assigned to a selected user, but then I need the requestor to select only one of the assets, so I would ideally like to use a multiple choice field type, but when I try and use the g_form.addOption() method to add the users assets to the field nothing happens.
If I change the field type to a select box the same code works and the assets are added as expected, except the field only shows the first asset and you have to click the drop down arrow to show the rest.
Preferred option would be to use the multiple choice field type so how do I dynamically add multiple choice options?
Acceptable alternative would be to use the select box if the field can be expanded automatically, showing all assets.
Thanks in advance.
- Labels:
-
Best Practices
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2019 02:36 AM
Hi John,
Refer below link will definitely help you,
If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons! 🙂
Regards,
Pratiksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2019 02:49 AM
You should be able to achieve it by using a Reference variable and use reference qualifier to display only assets that are related a current user