How to create a reference qualifier where data is from table to be used for a variable of a catalog

Anastasia Ty-Ch
Tera Contributor

Hello everyone!

I need help in creating the correct reference qualifier for a variable of a catalog form.

We are using the table service_offering as a reference of the variable. We are using this table because we want everything to be data driven.

As you can see in the screenshot below, Forcepoint One Endpoint is available in locations Australia and United Kingdom while Postman is available in North America and Ireland.

 

C.jpg

 

This is what it should look like in the catalog form. If user select Forcepoint One Endpoint the only available locations should be Australia and United Kingdom 

A.jpg
If user select Postman, the only available locations should be North America and Ireland. 

B.jpg

This is the LOCATION variable and I can't figure out the correct reference qualifier to achieve the above output. Please help. Thank you.

 

D.jpg

 

1 ACCEPTED SOLUTION

@Anastasia Ty-Ch 

You should have 2 variables on your catalog item

1) reference to service_offering table so that user selects Service Offering

2) reference to cmn_location with advanced ref qualifier as this so that it shows only that locations associated to offering selected

javascript: 'sys_idIN' + current.variables.business_service_offering.location.sys_id.toString();

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

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Anastasia Ty-Ch 

Location field on service_offering is reference type. I am curious how it is storing 2 locations in your screenshot

your location variable should refer to cmn_location table

Then update your location variable ref qualifier as this

javascript: 'sys_idIN' + current.variables.business_service_offering.location.sys_id;

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

Hi @Ankur Bawiskar thank you for replying.

 

The location field on service_offering was modified as List to store multiple locations

SO1.jpg

I copied the exact reference qualifier you provided but it didn't work

javascript: 'sys_idIN' + current.variables.business_service_offering.location.sys_id;

@Anastasia Ty-Ch 

You should have 2 variables on your catalog item

1) reference to service_offering table so that user selects Service Offering

2) reference to cmn_location with advanced ref qualifier as this so that it shows only that locations associated to offering selected

javascript: 'sys_idIN' + current.variables.business_service_offering.location.sys_id.toString();

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

Hi Sir @Ankur Bawiskar, I followed your instruction but now, it shows a lot of incorrect locations

1. Business Service Offering
SAMPLE1.jpg

 

2. Location
SAMPLE2.jpg

 

3. Result:

 

SAMPLE3.jpg