Reference field as choice list with reference qualifiers

Sharang
ServiceNow Employee
ServiceNow Employee

Hello!
I'm having 2 reference fields on a form (Ref1 and Ref2, both mandatory). I'm trying to show both these fields as choice list (instead of the default lookup).
Along with this I'm using an advanced reference qualifier for Ref2 which is something like :

javascript: ‘ref2_field=’+current.ref1

This works fine when Ref2 is lookup based (not a choice list, Ref1 is choice list) but when I make Ref2 a choice list, it doesn't show the appropriate choices (only displays None)

My thoughts: I think its happening cause when Ref2 is lookup based, the current variable is taken when I click the magnifying glass (at this point Ref1 has been populated). But when Ref2 is choice list, the choices are fetched when the form loads and in case of a new record, Ref1 contains no value, hence no results displayed under Ref2.

Any solutions for this while keeping both fields as choice lists?

 

Thank you!

1 ACCEPTED SOLUTION

Ujjawal Vishnoi
Mega Sage
Mega Sage

Add variable attribute in the variable where you have reference qualifier  i guess it is ref2.

Use variable attribute as below.

ref_qual_elements=ref1

 

Please refer the documentation here.

https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-manage...

 

Hope it helps.

View solution in original post

1 REPLY 1

Ujjawal Vishnoi
Mega Sage
Mega Sage

Add variable attribute in the variable where you have reference qualifier  i guess it is ref2.

Use variable attribute as below.

ref_qual_elements=ref1

 

Please refer the documentation here.

https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-manage...

 

Hope it helps.