Choices are not displaying as per the sequence given but displaying as per alphabetical order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 11:08 PM
Hi All,
I have to create a variable in record producer which should allow multi selection of the choices. So i selected the type as list collector and table as sys_choice and created choices in sys_choice. It's working fine but it's not getting displayed as per the given sequence but in Alphabetical order. Client wanted the choices to be displayed in the given order only. How do i do it.
Regards,
Swetha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 11:47 PM
Why didn't you create a multiple choice variable and added the choices on the variable itself? You could easily just use the 'order' field to set the order of the choices. Upside: the client can maintain these themselves, while the sys_choice table is restricted to admins.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2024 11:51 PM
Hi @Swetha Guligari
As per the understanding, this is not possible, you can discuss the same with the client that you can show the choice in ascending/descending order, and if they agree then it would be good.
Else you can create a new field as ORDER and mention the same order in which the client is asking and run your script accordingly.
Please mark this as helpful if this resolves your query.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2024 12:29 AM
There is no possible way to achieve your requirement as list collector variable displays the values in alphabetical order of the field which is defined as Display = true in dictionary.
As a workaround please check with your client whether you can add some prefix (like 1-,2- or 1.,2.) before the Label.
If this answer your question, please mark it as helpful or correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2024 10:08 AM - edited ‎02-13-2024 10:09 AM
This is a little janky but it works if you aren't trying to show a ton of choices. Add a Client Script for on load or on Change. Have the script remove the choices, then re-add them in the order you want them displayed. If you need to update or change the choices often, this is not an ideal solution.
Basic version for onLoad
function onLoad() {
//We want to have the Basic User as the first choice, but Alphabetically this doesn't work so remove and add the choices
g_form.removeOption('category','choice_1',"Basic User");
g_form.removeOption('category','choice_2',"Advanced User");
g_form.removeOption('category','choice_3',"Administrator Account");
g_form.addOption('category','choice_1',"Basic User");
g_form.addOption('category','choice_2',"Advanced User");
g_form.addOption('category','choice_3',"Administrator Account");
}