Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Populating variables in Choice List

ray evans
Tera Guru

I have a UI action on the Incident form which redirects to a catalog item form for creating a new request, which links back to the incident. I want to be able to populate some of the variables on the form using an onLoad UI client script,  the first being a select box on the catalog item, and also some values from the incident.

 

I have tried g_form.setValue('what_do_you_want_to_do', 'swap_asset'); but it isn't populating the variable

 

 

1 ACCEPTED SOLUTION

@ray evans 

then check this link which talks how you can send value over URL as parameter and then retrieve it on catalog form

3 Ways to Populate Values in ServiceNow via the URL 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@ray evans 

so you want to pass category value to some variable on that catalog item?

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

@Ankur Bawiskar I want to define the value from the choices in the select box variable, then I want to pass values from Incident for catalog item

@ray evans 

so the select box should show choices from category field on incident form?

OR

Can you explain your question with some screenshots?

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

The select box is on the catalog item - I want to define the value if the form is opened from the UI action on incident

rayevans_0-1681727872469.png

 

Then I want to populate some of the fields below from the fields on incident

rayevans_0-1681728078645.png