Skip to main content

Display dropdown values via client script

  • Apr 15, 2024 10:05 AM UTC
  • 3 replies
  • 151 views

Forum|alt.badge.img+7

Hi All,

when i am trying to display drop down values via client script getting empty values in the dropdown column .I have added the script in events after data load. Even  tried with only “setControlOptions('task_steps', 'user_def10', ‘PASS’)” but still same no value displayed in the screen.

Kindly suggest the way to populate the dropdown values via CS and correct me if i did any thing wrong in below code.

 

var emptyOptions = [];
var options = createCodeTableOption('','');
arrayPush(emptyOptions, options);
setControlOptions('task_steps', 'user_def10', emptyOptions);
    var opt1 = []; 
     
    arrayPush(opt1, createCodeTableOption('PASS','Pass'));
    arrayPush(opt1, createCodeTableOption('FAIL','Fail'));
    arrayPush(opt1, createCodeTableOption('NA','N/A'));
 
    setControlOptions('task_steps', 'user_def10', opt1);     

 

Thanks,

Durga

3 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • Apr 15, 2024 11:05 AM UTC

Hi @Durga 

Looks like a few redundant steps. Try the following

var opt1 = []; 

arrayPush(opt1, createCodeTableOption('PASS','Pass'));
arrayPush(opt1, createCodeTableOption('FAIL','Fail'));
arrayPush(opt1, createCodeTableOption('NA','N/A'));

setControlOptions('task_steps', 'user_def10', opt1);
return;

Cheers!


Forum|alt.badge.img+7
  • Author
  • Sidekick (Partner)
  • Apr 15, 2024 5:37 PM UTC

HI @Shneor Cheshin 

 

I have  followed same steps but still same not able to see the values in the dropdown .

 

 

Thanks,

Durga


Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • Apr 16, 2024 12:33 AM UTC

 @Durga 

I was not aware this is a list control you are trying to populate.

What I can recommend is:

  1. Use a lookup control instead of a dropdown
  2. Try using the ‘Row’ functions such as ‘setRowControlValue()’

While I am confident that a lookup will work, the second option needs to be further investigated and checked if feasible.

Cheers!