Catalogue Client Script on select box variables

B Ashok
Tera Guru

Hello Team, 

 

We have created catalogue ITEM, for dynamic field value selection. I wrote a catalogue Client script, when I checked the "request type" field values, these are displaying in the Alphabet order some time and some time displaying based on Order number. I would like to display values order wide not in alphabet wide. Please help on this. 

 

Based on Order :

BAshok_0-1737054512042.png

 

Based on Alphabet :

BAshok_1-1737054717005.png

 

I wrote catalogue client Script

BAshok_2-1737054806405.png

 

1 ACCEPTED SOLUTION

IamAmolB
Tera Guru

Hi @B Ashok ,

Can you try below code,

g_form.addOption('var_3', 'choice_1', 'Choice1', 1);
g_form.addOption('var_3', 'choice_2', 'Choice2', 2);

for reference developer portal link - https://developer.servicenow.com/dev.do#!/reference/api/xanadu/client/c_GlideFormAPI#r_GlideformAddO...

 

Please mark the correct answer if this solve your issue

 

Regards,

Amol Bavaskar

View solution in original post

2 REPLIES 2

Pankaj kr
Kilo Sage

Hi Ashok,

 

I found a community post with similiar query, have a look and try if it fixes your issue.

 

If this works kindly give a thumbs up and mark it as answered.

IamAmolB
Tera Guru

Hi @B Ashok ,

Can you try below code,

g_form.addOption('var_3', 'choice_1', 'Choice1', 1);
g_form.addOption('var_3', 'choice_2', 'Choice2', 2);

for reference developer portal link - https://developer.servicenow.com/dev.do#!/reference/api/xanadu/client/c_GlideFormAPI#r_GlideformAddO...

 

Please mark the correct answer if this solve your issue

 

Regards,

Amol Bavaskar