Want to show RITM variable in the sysapproval_approver .

NeethuB
Tera Contributor

Want to show RITM variable in the sysapproval_approver.
For that i have created a feild called description (u_description).
I want to show data inside that feild.
eg:
Title:xyx
requestot:ghi 

22 REPLIES 22

@NeethuB 

it should work fine, share your BR configuration screenshots and the script you are using

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have shared it

@NeethuB 

does your RITM contain MRVS? if yes then you will have to enhance the script I shared

did you add logs and see what came and what debugging did you do?

Use this and share the logs with us

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var arr = [];
    var ritm = new GlideRecord('sc_req_item');
    ritm.get('sys_id', current.sysapproval);
    var variables = ritm.variables.getElements();
    gs.info('variable length' + variables.length);
    for (var i = 0; i < variables.length; i++) {
        var question = variables[i].getQuestion();
        var label = question.getLabel();
        var value = question.getDisplayValue();
        if (label != '') {
            arr.push('  ' + label + " = " + value + "\n");
        }
    }
    gs.info('array of variables is' + arr.toString());
    current.u_description = 'Variable Summary\n' + arr.toString();

})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

No we don't have MRVS.

Hi @NeethuB,

 

If you are using Flow Designer for the fulfillment process, you can update the description from the flow. Use lookup records action, table shall be sysapproval_approver, condition: Task is (Requested Item Datapil). And for multiple approvers, do For Each Flow logic, take the look up record datapil and update each record Description field with required information using datapils.

 

Regards,

Ehab