Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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.

5 REPLIES 5

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

Tanushree Maiti
Kilo Patron

Hi @dhivyal94299399 

 

Check this : Accessing Multi-Row Variable Set value outside the Multi-Row Variable Set [Catalog Item, Client Side...

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: