An approvals hub
Before you start
You will build a payment approvals hub. A colleague fills in a request, the form refuses an incomplete one, the right people are asked to decide, a daily reminder chases the slow ones, the approved request becomes a signed letter, and finance receives the result through its API. The same hub handles any other request that needs a decision, such as leave or equipment. Plan on two to three hours.
- Request form
- Route by amount
- Approve
- Remind
- Sign and file
- Post to finance
You need the Quickstart behind you. It builds the smallest version of this: one approval with an Approved and a Rejected path.
What are we building?
Section titled “What are we building?”One module, Payment Requests, with a form, a board and a record page. Three workflows work on it: one routes the request, one sends daily reminders, one produces the letter. A permission profile for each group of people keeps the records where they belong.
Which fields does the module need?
Section titled “Which fields does the module need?”| Field | Type | Notes |
|---|---|---|
| Request number | Text | Default value is a Smart Script that numbers each request, PAY-00001 and on |
| Requester | User | The person asking |
| Manager | User | Who approves first |
| Payee | Text | Who gets paid |
| Amount | Currency | The routing field |
| Category | Lookup | Travel, Equipment, Services, Training |
| Justification | Text area | Asked only above a threshold |
| Status | Lookup | Draft, Pending Manager, Pending Finance, Approved, Rejected, Paid |
| Rejection reason | Text area | Filled by the workflow |
| Approver signature | Signature | A pen signature drawn on screen |
| Approval letter | Content | The generated file |
The numbering script is the one the demo workspace uses for every reference number:
var pad = '00000';var n = $AUTO_INCREMENT$;var result = (pad+n).slice(-pad.length);'PAY'.concat('-').concat(result);Create the Category and Status lookups under Lookups first, then add the fields. See Add a field and Set a default value.
How does the form stop an incomplete request?
Section titled “How does the form stop an incomplete request?”Build the form in blocks: Request, Money, Justification, Approval. Two features do the checking.
- A Block rule on Justification: Show when Amount is greater than 50,000. Below that, the block is hidden, so small requests stay short.
- A Rule Book entry that runs before the save. Give it a Rule Code such as
AMT-1, Severity Block, a Decision Message ofThe amount must be more than 0, and a script that returns true to pass:
parseFloat($cm_payment_requests_base$.$amount$) > 0;Insert the token with Insert data so the table name matches your module. A Block entry is a hard stop. A Warning entry lets the person proceed. Make the Approver signature field read-only for everyone but finance with a field rule, or with the permission profile later. See Stop bad data with the Rule Book and Show or lock a block with rules.
How is a request routed?
Section titled “How is a request routed?”Create a workflow on Payment Requests that runs when A record is created, After the record is saved (POST). Name it Route payment request.
- Add Approval task. Set Title people will see to
Approve payment, Priority to High, Overdue after to 2 days. Under Who decides?, choose A field on the record and pick Manager. - Tick Set a stage on the record, choose the Status lookup and the stage Pending Manager.
- On the Rejected path, add Record manager: Update, set Status to Rejected. Tick Add the rejection reason to the record on the approval step and pick Rejection reason.
- On the Approved path, add Decision. Condition: Amount is greater than 50,000.
- On its Yes path, add a second Approval task. Who decides?: A role, Finance Director. Stage: Pending Finance. Add the same Rejected update.
- Add Record manager after the second approval: Update, Status to Approved. Drag the End of the No path onto this step, so both paths meet at it.
Two things worth knowing about the approval step:
- The workflow pauses at the step. When someone decides, it continues down Approved or Rejected with a fresh copy of the record.
- For two people who must both approve, chain two approval steps, as step 5 does. Each step is completed by the first person who decides.
Click Check before you save, then turn the workflow on. See Approvals and tasks and Decision.
How do approvers work their tasks?
Section titled “How do approvers work their tasks?”Each task lands in the approver’s Tasks inbox in App space, and on the record itself. The approver can Approve, Reject with a reason, or Request Clarification. Tick Let the approver return it to the sender on a later step if the finance approver may send it back to the manager.
How do I chase slow approvals?
Section titled “How do I chase slow approvals?”Overdue after marks a task as overdue in the inbox. For a reminder, build a scheduled workflow.
- On Payment Requests, create a workflow named
Daily approval reminder. Choose Adhoc as the trigger. - Turn on Also run on a schedule and choose Every day at 09:00. Check Next runs under it.
- Add Load data. Choose Payment Requests, match Status is Pending Manager or Pending Finance, sort by oldest first, and name the list
waiting. - Add Send email. Send it from your mail sender to a shared inbox. Add a Table that repeats for each row of
waiting, with the request number, payee, amount and manager.
A scheduled run has no starting record, so the workflow loads its own data. That is why step 3 exists. If no mail sender is set up, the email step fails; see Emails aren’t being sent.
To email each approver directly, add a Manager email text field to the form and use it in To.
How is the request signed and filed?
Section titled “How is the request signed and filed?”Prepare a Word template under Document generation with placeholders such as ${request_number} and ${amount}, and a bookmark where the signature goes. Then:
- On Payment Requests, create an Adhoc workflow named
Issue approval letter. - Add Smart document. Choose the template, Fill the placeholders from the record, and tick Add a signature. Pick Approver signature as the Signature field and type the Bookmark name.
- Tick Also put it in a file field and choose Approval letter.
- In the Smart view for Payment Requests, add an Action button, Issue letter, that runs this workflow. Show it only when Status is Approved.
The finance approver draws the signature on the Approver signature field of the record, then presses Issue letter. See Generate Word documents from records and Add action buttons to a record page.
How does finance receive it?
Section titled “How does finance receive it?”At the end of Route payment request, after Status becomes Approved, add a REST API step.
- Method
POST, to your finance system’s endpoint. - Authentication: an API key or a Bearer token, stored securely in the step.
- A JSON body that inserts the request number, payee and amount from the record.
- Leave Stop the workflow on an error reply on, so a refused post shows as a failed run.
If the finance system has no API, a Web agent step can drive its web screens instead. See REST API. When the post fails, the run debugger shows the reply. See Find out why a workflow failed.
Who should see what?
Section titled “Who should see what?”| Profile | Setting |
|---|---|
| Requesters | Create and view Payment Requests. Team records off, so each sees only their own |
| Managers | Team records on, so a manager sees requests created by their team |
| Finance | All records. Edit on Approver signature |
| Approvers | A rule on Payment Requests: a record where I have an open task |
The last rule lets someone see exactly the requests waiting on them. Permission changes apply the next time those people sign in.
What can I change?
Section titled “What can I change?”- Leave requests use the same shape. Replace Amount with Days, route by days and by the requester’s team.
- Different entities. Add an Entity lookup and put a Decision on it first, then give each entity its own approvers.
- More levels. Chain another Approval task after the Decision for a CEO threshold.
- Process insights. App space shows where requests spend their time. See Your task inbox.
Where can I read the story?
Section titled “Where can I read the story?”The Solutions page follows one request from capture to finance: Approvals and requests.
Check yourself
What's next
Last checked