Multi-Row Variable Set: How to control or set values outside MVRS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 07:31 PM
Hi,
In my case, I have a variable set that contains one variable that should control the other variable outside the MRVS.
1. If user select Traveling Advance = "No",
2. The variables for "Air Ticket" and "Hotel Booking" should be optional, based on user selection on Traveling Advance = "No"
Is there any suggestion on how to make it work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 10:22 PM - edited 07-16-2024 10:25 PM
Hi @nurinasyikin_ ,
You can use Catalog UI Policy for that, you'll have access to all the variables there along with your MRVS variables.
You just need the knowledge of implementing the UI Policy of this.
Try this documentation for understanding : https://qualityclouds.com/documentation/qcr/rules/service-catalog-ui-policy/
Thanks,
Hope this helps.
If my response turns useful, please mark it helpful and accept solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2024 06:59 PM
Hi @HrishabhKumar, I am able to access the variable set name from the Catalog UI Policy, but not able to access specific variables inside the variable set to control the conditions as mentioned above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 11:21 PM
You can simply write client script in this way on cat item:
var value = g_form.getValue('traveling_advance');
if (value == "no"){
g_form.setMandatory('field_name', false)
...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2024 10:47 PM
Hello @nurinasyikin_
Try the below sample onchange catalog client script:
(function() {
// Trigger this script on change of Traveling Advance field
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
// Get the value of Traveling Advance
var travelingAdvance = g_form.getValue('traveling_advance'); // Adjust the field name as per your actual variable name
// Check if Traveling Advance is set to "No"
if (travelingAdvance === 'No') {
// Make Air Ticket and Hotel Booking optional
g_form.setMandatory('air_ticket', false); // Adjust the field name as per your actual variable name
g_form.setMandatory('hotel_booking', false); // Adjust the field name as per your actual variable name
} else {
// Make Air Ticket and Hotel Booking mandatory
g_form.setMandatory('air_ticket', true); // Adjust the field name as per your actual variable name
g_form.setMandatory('hotel_booking', true); // Adjust the field name as per your actual variable name
}
}
// Register the onChange function
g_form.getControl('traveling_advance').onchange = onChange; // Adjust the field name as per your actual variable name
})();