Validating that a document is attached with the Approval

JVOGEL11
Tera Contributor

I would like an approver to attach a document with their approval.  If they hit 'Approve' without the attachment present, then it should prompt a message to add the attachment.    I also need this to work only when the 'ask for approval' is invoked from a particular flow (e.g., Process Shop Request).   I am thinking this might be a business rule or client script, but not sure the best approach.  Any thoughts are appreciated 🙂 

 

 

8 REPLIES 8

Anurag Tripathi
Mega Patron
Mega Patron

You can validate this on server side using the below script, a before BR should work.

Using the condition of the BR you can add condition to ensure you are capturing the right approval record and action (approval/rejection)

current.hasAttachments();

 

-Anurag

Thank you - if this BR is on the 'sysapproval_approver' table,  what condition / script would I use to make sure the approval is related to a particular catalog item category?  Not every approval requires an attached document, just certain ones.  

 

You can dot walk to the task record (approval for) and use the table name/short description etc.

Something like

approval_for.task_type = RITM

Approvalform.requested_item.item = <item name>

AnuragTripathi_0-1709315657944.png

 

To dot walk from approval for (which is a field referenced to task table) to item field you will need to check this out -> Dot Walk from Parent to Child Table - ServiceNow Community

 

 

-Anurag

@JVOGEL11 did this work?

-Anurag