Multi-row variable sets, at least for me, is like an important breakthrough in Service catalogs. They serve a whole load of business use cases.
For instance, consider the scenario of automation in Onboarding Users/groups/roles, etc. There could be a provision to allow requesters to submit multiple records of such information, for instance, multiple users being tagged to multiple groups, roles, etc. This information is stored as a JSON object once the catalog is submitted.
This detail can be pulled later from the server with no limitations. However, on the client-side, there are few downsides, which are discussed below.
Another problem with MRVS is, the variables under it cannot be marked Global. And in case there are catalog tasks taking the submitted variable pool in their form layout, MRVS variables cannot be displayed there.
Cherry on top: we cannot show/hide visibility on the variables under the multi-row variable set using UI policies, which is a bummer. And the reason behind this being, the MRVS variables are not considered global.
If you try and create a UI policy for a MRVS, the truth reveals itself when u see the heart-breaking sight of 'Visible' field set to read-only.
I have found out a workaround though (Nah, you wouldn't like it): Using a javascript executor, I set the 'Visible' field as read-only false :)
There is however a possibility to do this using a simple glideAjax by sending the parameter as the field that decides the validation of read-only/auto-population. If not, something similar can be done onLoad as well.
Or if things are pretty straightforward, where you want to show/hide variables, make them mandatory, read-only - all of this can be done using Client scripts as usual, fingers crossed.
Oh yes - all the validations i mentioned above holds good only after we use the 'Add' button and open the flyout window with variables in the MRVS :)
List collector fields are not supported in Multi-row variable sets (pre-Quebec)
There is no possibility (at least with Quebec) to manipulate validations on the MRVS from the catalog since it is a grid view.
MRVS, in integrations, also need to be treated quite differently. For instance, there is a MRVS called 'group_details' and you would want to pass variables under that MRVS, say group_name.
var mrvs1 = [{"group_name": "string/sys_id/choice based on the variable type"}];
var mrvs = JSON.stringify(mrvs1);
var reqbody = {
sysparm_quantity: 1,
"variables": {
"group_details": mrvs,
}
};
var reqbodys = JSON.stringify(reqbody);
Try the below as well, in case there above snaps:
"variables": {
"group_details": {"group_name_ref":"30ee6161dbf26340d3f5f6532c9619ef"},
}
Few important links:
https://community.servicenow.com/community?id=community_blog&sys_id=865b5aeddbc023c0feb1a851ca9619f9
https://community.servicenow.com/community?id=community_blog&sys_id=15d6c8811b328010a59033f2cd4bcbf9
Comments