We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Catalog Related Query

PrajaktaG308421
Mega Guru

 

Is Advanced Reference Qualifier supported for MRVS reference variables when dependency is on a Catalog Item variable?
What is the recommended approach ?

 

3 REPLIES 3

PrajaktaG308421
Mega Guru

I am working on a Service Catalog requirement and need guidance on handling dependent variables between a Catalog Item variable and an MRVS variable.

 Scenario:

I have a Catalog Item with:

Program (Select Box) – This is a normal Catalog Item variable.

A Multi-Row Variable Set (MRVS) which contains:

Job (Reference variable)

I have created a custom table (e.g., u_program_job_dependency) to manage dependency mapping with fields such as:

Catalog Item (Reference to sc_cat_item)

Dependent Field (Program)

Dependent Value

Unique Key

Name (Job)

Sample mapping:

Program = Test1 → Job = N1

Program = Test2 → Job = N2

Requirement:

When the user selects:

Program = Test1 → Only N1 should be available in the Job reference field inside MRVS

Program = Test2 → Only N2 should be available in the Job reference field inside MRVS

This filtering should apply dynamically for all rows inside the MRVS.

yashkamde
Kilo Sage

Hello @PrajaktaG308421 ,

 

As per my understanding, Advanced Reference Qualifiers are not natively supported for MRVS reference variables when the dependency is on a Catalog Item variable. The MRVS context is isolated from the parent Catalog Item variables, so you cannot directly access those values in the qualifier script. This is a known limitation in ServiceNow’s catalog framework.

 

Refer to this article that uses a Catalog Item variable value in a MRVS variable reference qualifier :

Yes, You Can Effectively Set or Update a Reference Qualifier Via Script! 

If my response helped mark as helpful and accept the solution.

Ankur Bawiskar
Tera Patron

@PrajaktaG308421 

So variable within MRVS should have reference qualifier based on outside variable

yes this is possible you can access outside variable in reference qualifier of MRVS variable

see these links for help

SOLVED: Issue with MRVS multi row variable set accessing the form values 

Yes, You Can Effectively Set or Update a Reference Qualifier Via Script! 

OR
Another easy approach I recently shared solution here

How to pass a value from one variable set to another variable set in catalog form 

1) create a hidden single line text variable within MRVS and hide it always

2) use onLoad catalog client script which runs on MRVS and set this hidden variable with outside variable

function onLoad() {
    g_form.setValue('hiddenVariable', g_service_catalog.parent.getValue("requested_for"));
}

3) now you have outside variable value available within MRVS and you can apply ref qualifier on your variable like this

javascript: 'u_approver_reviewer=' + current.variables.hiddenVariable + '^ORu_secondary_approver_id_confirmation=' + current.variables.hiddenVariable;​

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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