The CreatorCon Call for Content is officially open! Get started here.

How to add choices to Lookup Select Box via script

Community Alums
Not applicable

I need to set up values dynamically for lookup select box. Tried the below one, it did not work. I am sure it has to be something else. Need help.

g_form.addOption('select_form', catitem.sys_id, catitem.name);

3 REPLIES 3

Kalaiarasan Pus
Giga Sage

Lookup select picks the value from a table to show on the form. Why don't you add the records permanently to the underlying table instead of adding it on the form?


srinivasthelu
Tera Guru

It should work.



Can you try hardcoding and see



g_form.addOption('select_form', 'catitem.sys_id', 'catitem.name');



Thanks


Srinivas


Community Alums
Not applicable

Yes, no need to use this g_form.addOption('select_form', catitem.sys_id, catitem.name);



I have a parent field(reference), when I assign a value dynamically to this, it populated the dependent on in the lookup select box.



Thanks Kalai, for the hint.