MultiRow Variable Set

dhivyal94299399
Tera Contributor

Hi

I Have a reference field called "A "outside the variable set(in parent catalog item).

I have variable set which has reference field called "B".

I want to show list of records in reference field of B based on the value selected in A.

6 REPLIES 6

Ankur Bawiskar
Tera Patron

@dhivyal94299399 

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

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

hi @Ankur Bawiskar 

 

I dont want to create any hidden fields, I want to achieve this using script.

Please do let me know if you have any script

@dhivyal94299399 

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! 

💡 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

@dhivyal94299399 

Hope you are doing good.

Did my reply answer your question?

💡 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