In the catalog item workflow approval will goes to user selected in the variable

Servicenow de11
Tera Contributor

Hello,

 

I have a requirement that is user selected in the catalog item variable(single line text) approval will goes to the person existing in the variable.

Please help me to achieve this.

 

Thanks 

1 ACCEPTED SOLUTION

Hello @Servicenow de11 ,

 

Use this-

Harsh_Deep_0-1698391684933.png

and use this script -

var answer = getAnswer();

function getAnswer(){
var user = current.variables.YourRequiredField.toString();
var grUser = new GlideRecord('sys_user');
grUser.addQuery('name',user);
if(grUser.next()){
    return grUser.sys_id;
}
}

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

View solution in original post

11 REPLIES 11

Hello Harsh deep

 

Tried the given script but no luck. Attached screenshot

Approval not triggered.

 

Thanks

Hello @Servicenow de11 

 

Don't use answer =[]; this line.

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.