- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 05:20 AM
I added using a script the question choices
g_form.addOption('type_of_issue', choice.value, choice.label, choice.order);
But when i tried to get the label, what is showing is the value
producer.type_of_issue.getDisplayValue();
Any idea what else can tried?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 06:14 AM
Hello @Abigail ,
I think that the problem is coming from there that when the Catalog Item is submitted, only the values are passed. What I can offer you as a solution if there are not that many options and you want to stick with the script you can add all possible options in the Dictionary, then remove in onLoad client script all the fields that you don't want initially with g_form.removeOption('priority', '1'), then you can use your logic to clear/populate the options<with you current scripts>, and when the form is submitted you are going to be able to see the Label for that value, because on that value there is a corresponding Label in the question_choice table.
Another approach might be to use and Lookup Select Box variable with an advanced reference qualifier and with some scripting you can do the same.
And your final option is a widget with an hidden field to show on the RITM/Task but lets hope that you don't go there.
Hope that this helps you!
If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.
All the Best,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 05:27 AM
Hi @Abigail ,
Why are using a script to add the Choice? Why not using Dictionary?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 05:34 AM
Hello @Community Alums
I used the script because the select box dependent on another select box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 06:14 AM
Hello @Abigail ,
I think that the problem is coming from there that when the Catalog Item is submitted, only the values are passed. What I can offer you as a solution if there are not that many options and you want to stick with the script you can add all possible options in the Dictionary, then remove in onLoad client script all the fields that you don't want initially with g_form.removeOption('priority', '1'), then you can use your logic to clear/populate the options<with you current scripts>, and when the form is submitted you are going to be able to see the Label for that value, because on that value there is a corresponding Label in the question_choice table.
Another approach might be to use and Lookup Select Box variable with an advanced reference qualifier and with some scripting you can do the same.
And your final option is a widget with an hidden field to show on the RITM/Task but lets hope that you don't go there.
Hope that this helps you!
If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.
All the Best,
Stefan