Validating that a document is attached with the Approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 12:15 PM
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 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 09:43 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 09:47 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2024 09:55 AM - edited 03-01-2024 09:55 AM
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>
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 05:52 AM
@JVOGEL11 did this work?