Filter a catalog variable values based on other variables

Joshuu
Kilo Sage

Hi All,

 

I have below fields on a catalog form. When we select 'Hotel Code', the values under 'Hotel Status', 'Brand' and 'Country' will auto populate. And the 'Rate Category' is reference to a custom table. We also have brand and country in that custom table as well of type list.

 

So, the 'Brand' and 'Country' on the catalog form should check the custom table's 'Brand' and 'Country' if there is any match those rate categories should only get filtered and show them on the 'Rate Category' variable on the catalog form.

 

priyarao_0-1743077983392.png

Can we use a Reference Qualifier for this? Please assist.

 

Thanks & Regards.

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Joshuu 

something like this in the reference qualifier

javascript:'brandFieldIN' + current.variables.brandVariableName + '^countryFieldIN' + current.variables.countryVariableName;

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

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

View solution in original post

Medi C
Giga Sage

Hello @Joshuu,
 
Please adjust the reference qualifier for Rate Category as follow:

javascript: 'brand=' + current.variables.brand + '^country=' + current.variables.country

 

javascript: 'brand=' + current.variables.brand + '^country=' + current.variables.country

 

 

  1. "brand=" --> replace brand with the technical name of brand on your custom table
  2. "current.variables.brand=" --> replace brand with the technical name of your variable on the catalog item
  3. (Do the same 1 and 2 steps for country) 

If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Joshuu 

something like this in the reference qualifier

javascript:'brandFieldIN' + current.variables.brandVariableName + '^countryFieldIN' + current.variables.countryVariableName;

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

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

@Joshuu 

If brand and country field on your custom table are of type list then you need to use IN and not =

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

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

Medi C
Giga Sage

Hello @Joshuu,
 
Please adjust the reference qualifier for Rate Category as follow:

javascript: 'brand=' + current.variables.brand + '^country=' + current.variables.country

 

javascript: 'brand=' + current.variables.brand + '^country=' + current.variables.country

 

 

  1. "brand=" --> replace brand with the technical name of brand on your custom table
  2. "current.variables.brand=" --> replace brand with the technical name of your variable on the catalog item
  3. (Do the same 1 and 2 steps for country) 

If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.