Add Approve and Reject button on approval table which are visible on workspace

Prudhvi Raj Y
Tera Expert

Hi,

 

We have workspace where users are able to approve the request from sysapproval_approver table but there are no Approve and Reject button from workspace I have tried to add custom once but button is not getting visible on workspace.

PrudhviRajY_0-1784610772782.png

Please let me know if something is missing.

 

Regards,

Prudhvi

1 ACCEPTED SOLUTION

Vikram Reddy
Tera Guru

Yes, this can be done using Declarative Actions in Configurable Workspace. Try these steps:

  1. Create two Form Declarative Actions on sysapproval_approver: Approve and Reject.

  2. Use this visibility condition:

current.state == 'requested' &&
(gs.hasRole('approval_admin') ||
 new global.ApprovalDelegationUtil().isMyApproval(current))
  1. Approve script:
current.state = 'approved';
current.update();
new global.ApprovalUserFeedback().approved(current);
  1. Reject script:
current.state = 'rejected';
current.update();
new global.ApprovalUserFeedback().rejected(current);
  1. Create corresponding records in:
    • sys_ux_form_action
    • sys_ux_form_action_layout_item
  2. Add both layout items to the Form Action Layout used by your Workspace.

I verified in my instance, this should work

 

Thank you,

Vikram Karety,

Octigo Solutions INC

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron

@Prudhvi Raj Y 

workspace is for agents and not for approvers

Why approvers will use Workspace.

I will suggest you inform this to your customer and train them about the platform features

Approvers usually approve from either of the below 2 places

1) replying to email they receive

OR

2) via ESC portal

OR

3) via native view (not many customers are using this now for their approvers)

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar ,

 

Agreed, but the issue is we are using approval with emails or portal as this is custom application users want to handle the approval from workspace only 

@Prudhvi Raj Y 

I still feel there is no strong case for approvers to use workspace and they should be trained to use the OOTB ways

Why they can't use ESC Portal to approve/reject?

Why they can't reply to emails to approve/reject?

If your business still requires you will need to see why the OOTB buttons are not coming in workspace OR create new ones for approval from your custom table only

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Tejas Adhalrao
Kilo Sage

Hi @Prudhvi Raj Y  ,

you have to create Declearative action  for workspace .

TejasAdhalrao_0-1784614921597.png

ex: you have to create button on form 

1) click on "form actions" -> click new 

2) give name  , select table 

TejasAdhalrao_1-1784615020303.png

and submit 

 

If you found my solution helpful, please mark it as Helpful and Accept Solution.

thanks ,

tejas😊