Multi Row Variable Set to RITM Comments/SC Task Description

Aaron25
Tera Guru

Hi Everyone,

 

Just curious if anyone has done this before with the populated variables from an MRVS to display in the RITM Comments and/or SC Task.

 

Would this be done in the workflow for the catalog item or a different area? The reason we want to set this up is the global search for the MRVS is not doable in ServiceNow so wanted to paste the input from the user on the catalog item to the description in a format similar to below:

 

Description:

MRVS_Variable_1 : Name

MRVS_Variable_2 : Number

MRVS_Variable_3: Description

 

Repeats if there is more than 1 row.

 

Or if anyone knows how to make the MRVS data searchable via the global search that would work also.

 

 

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

Hello @Aaron25 ,

you can write some script in a business rule may be to update the description of your RITM .

it can be an before insert BR with the condition as "Item is your item name"-->To make sure BR runs only for your catalog item and then try this kind of script below to parse the MVRS data as it returns data in JSON format.

 

var parsed = JSON.parse('your_mvrs_internal_name');

for(var i=0; i<parsed.length; i++)

{

current.description = "Row "+i+" : Name :" + parsed[i].your_name_variable_backendname + "Number : "+parsed[i].your_number_backend_name+"Description :"+parsed[i].your_description_backend_name+"\n";

}

Note :this code is untested but i am sure you can write this way which will populate your description 

 

Let me know if this works 

If my answer helped you in any way please mark it as correct

Thanks

View solution in original post

4 REPLIES 4

Mohith Devatte
Tera Sage
Tera Sage

Hello @Aaron25 ,

you can write some script in a business rule may be to update the description of your RITM .

it can be an before insert BR with the condition as "Item is your item name"-->To make sure BR runs only for your catalog item and then try this kind of script below to parse the MVRS data as it returns data in JSON format.

 

var parsed = JSON.parse('your_mvrs_internal_name');

for(var i=0; i<parsed.length; i++)

{

current.description = "Row "+i+" : Name :" + parsed[i].your_name_variable_backendname + "Number : "+parsed[i].your_number_backend_name+"Description :"+parsed[i].your_description_backend_name+"\n";

}

Note :this code is untested but i am sure you can write this way which will populate your description 

 

Let me know if this works 

If my answer helped you in any way please mark it as correct

Thanks

HI Mohith ,

 

Need some help i have same mrvs with name scheduled_tasks

in that we have a varaible called company

need populate ritm short description  by using runscript in workflow please help 

 

Aaron25
Tera Guru

Thanks Mohith,

 

I ended up doing this report below.

 

https://www.servicenow.com/community/developer-forum/how-do-report-on-multi-row-variable-set/m-p/162...

 

As the business stakeholders wanted to be able to report on it also. I will definitely try your solution for the next catalog item i have.

Aaron25
Tera Guru

https://www.servicenow.com/community/developer-forum/how-do-report-on-multi-row-variable-set/m-p/162... 

 

I also used that link above for reporting.

 

Thanks for your help Mohith