How to set values dynamically in variables

Rani11
Tera Expert

Hi All,

Just a small query.

I have Variable which is referring to custom table.

Custom Table :

find_real_file.png

 

Role Display is Reference variable and above "Test Table" is used for reference. So When i select US-Store in the "Role Display" it should show relevant "US"country related location in the "Location" variable. here if US-STORE (then it is US country store. If they select (NZ-Store) then its is News Zealand country store.

find_real_file.png

 

So i tried script include and reference qualifier like below. But whatever i tried that is static one. I just wants to change that to dynamic one as per above logic. 

 

Script Include :

getLocation: function(role_display) {
var gr=new GlideRecord('cmn_location');
return 'country=Australia^u_active=true';
},

Reference Qualifier :

javascript:new LocUtils().getLocation(current.variables.role_display)

Its working as expected. but if i have one store then it should be fine but i have many stores. So i just wanted to change this to dynamic one. can anyone help me on this?

 

Thanks in Advance!!!

 

1 ACCEPTED SOLUTION

Rani11
Tera Expert

I have created script include and called the script include in the reference variable using advance.It worked .

Thanks all for your support.

View solution in original post

11 REPLIES 11

Rani11
Tera Expert

I have created script include and called the script include in the reference variable using advance.It worked .

Thanks all for your support.

Great!  It looks like you marked your own response as the correct answer, which may be confusing to others that read this later.

The similar approach was mentioned in my earlier reply of using Script Include and Advanced ref qualifier.

Please consider marking appropriate reply as Correct & Helpful.

Regards
Ankur

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