Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to add static option on Lookup Select Box catalog item variable?

KS86
Tera Contributor

Hi,

I have one requirement.

 

I have three catalog form questions (Q1, Q2, Q3) referencing the same table. Q2 options depend on Q1, and Q3 options depend on Q2 using logic in a Script Include. I need to add a static option to Q3 regardless of the dynamic population. g_form.addOption() isn’t working. How can I achieve this?

8 REPLIES 8

Chaitanya ILCR
Mega Patron

Hi @KS86 ,

use reference qualifier 

have a record (for the static option)on the table that the choice field is referencing and use reference qualifier.

based on the condition or always

 

you can have the script include return the reference qualifier and use the script include in the q3 reference qualifier

 

if you still having issues

 

please share all the details of your business requirement

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

If I create the record in the table, Q3 is always showing up on form. It has to show only when we select any option in Q2.

Please assist.

@KS86 

How about hiding Q3 till anything is selected on Q2

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

There is already one client script is there which shows Q3 only when Q1 and Q2 are selected. But If I add that record on the table that client script also not working.