Add selected user as approver

Samiksha2
Mega Sage

Hi All,
I have an requirement:

There is a variable called Approver referencing to the user table and is hidden from the catalog view.
It is visible on requested item.
Fulfiller will work on Requested item and if they add any value in the Approver variable, approver should send to that user.
I tried to do in the flow designer, but it is not working when i update the form after adding the approver variable.

Please help me,

Thanks,
Sam

1 ACCEPTED SOLUTION

Bhavya11
Kilo Patron

Hi @Samiksha2 ,

 

can you try something like this

create Business rule 

Bhavya11_0-1734333547280.png

script like below

 if(current.variables.apprval_user != previous.variables.apprval_user)
    var approval_gr = new GlideRecord('sysapproval_approver');
    approval_gr.initialize();
    approval_gr.state = 'requested';
    approval_gr.approver = current.variables.apprval_user; // your variable here
    approval_gr.sysapproval = current.sys_id; //Current is record that requires approval
    approval_gr.insert();

 

 

Thanks,

BK

 

View solution in original post

2 REPLIES 2

Bhavya11
Kilo Patron

Hi @Samiksha2 ,

 

can you try something like this

create Business rule 

Bhavya11_0-1734333547280.png

script like below

 if(current.variables.apprval_user != previous.variables.apprval_user)
    var approval_gr = new GlideRecord('sysapproval_approver');
    approval_gr.initialize();
    approval_gr.state = 'requested';
    approval_gr.approver = current.variables.apprval_user; // your variable here
    approval_gr.sysapproval = current.sys_id; //Current is record that requires approval
    approval_gr.insert();

 

 

Thanks,

BK

 

Thanks @Bhavya11