Not able to setValue() in a lookup select box

Kevin Paul
Mega Guru

Hi,

I have a client script where I use the value of a variable as a reference to populate rest of the fields. But this is not working when it is a lookup select box. Why is it so? I have added the code here and the outcome.

find_real_file.png

Here intsall_status is a lookup select box in a catalog item. How can I set value in the field?

1 ACCEPTED SOLUTION

It worked, I changed the look up table of the variable from sys_choice to alm_asset.

View solution in original post

10 REPLIES 10

@Kevin Paul 

if you have your choice variable without the None option then it automatically shows the choice value with the lower order by default when form loads.

To avoid this you can include None if required

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Included that too, not working!

@Kevin Paul 

please share your variable configuration and the choices

If this is in your personal instance please share url and some admin credentials to this

ankurb.snow@gmail.com

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

It worked, I changed the look up table of the variable from sys_choice to alm_asset.

Glad to know.

If my response helped please close the thread by marking appropriate response as correct and helpful

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader