How to display the multi row variable in the widget on portal

kirankumarboyin
Mega Contributor

Hi All,

               I am using the custom widget in portal, which is displaying the normal variables on it. Now I want to display the Multi row variables in the same widget. I am having the catalog, where we are using multi row variable. Is there any way simplest I can get the Multi row variable using the server script.

I am using the below code displaying the normal variables, but it is not working for multi row variables.

var gr1 = new GlideRecord('sc_req_item');
if (gr1.get('e48e11701b47b7407b84751bdd4bcb0a')) { // sys_id of RITM
    for (var i1=0;i1<variables1.length;i1++) {
        var question1 = variables1[i1].getQuestion();
      if(question1.getValue()!='') gs.addInfoMessage(question1.getLabel() + "-------------" + question1.getDisplayValue());
}
}

I know If I know the internal name of the Multirow variable set, I can get the value like this gr1.variables.<internal_name_of_mvrs>  . But I need any generic code which will work for all the mvrs like as above normal variable script.

Is there any generic like as above to display the Multi row variable. Please help me on this.

Regards,

Kiran

2 REPLIES 2

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

Instead of creating a customization, you should take in consideration that this feature is already available in New York release . 

  • A multi-row variable set is now visible in the variable summarizer in Service Portal.

https://docs.servicenow.com/bundle/newyork-release-notes/page/release-notes/it-service-management/se...

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Thanks Albert,

            For the response, Now we are on Madrid version and client want us to see the mvrs in custom widget.

Is there any script code, where I can get the multi row variable.

 

Regards,

Kiran