Skip to content

An approvals hub

Recipe40 minPractitioner

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.

  1. Request form
  2. Route by amount
  3. Approve
  4. Remind
  5. Sign and file
  6. 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.

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.

FieldTypeNotes
Request numberTextDefault value is a Smart Script that numbers each request, PAY-00001 and on
RequesterUserThe person asking
ManagerUserWho approves first
PayeeTextWho gets paid
AmountCurrencyThe routing field
CategoryLookupTravel, Equipment, Services, Training
JustificationText areaAsked only above a threshold
StatusLookupDraft, Pending Manager, Pending Finance, Approved, Rejected, Paid
Rejection reasonText areaFilled by the workflow
Approver signatureSignatureA pen signature drawn on screen
Approval letterContentThe 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 of The 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.

Create a workflow on Payment Requests that runs when A record is created, After the record is saved (POST). Name it Route payment request.

  1. 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.
  2. Tick Set a stage on the record, choose the Status lookup and the stage Pending Manager.
  3. 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.
  4. On the Approved path, add Decision. Condition: Amount is greater than 50,000.
  5. On its Yes path, add a second Approval task. Who decides?: A role, Finance Director. Stage: Pending Finance. Add the same Rejected update.
  6. 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.
The workflow designer with the Approval task step selected. The side panel shows the task title, the priority, the Overdue after setting and the Who decides? choices.
    Title people will see is the task’s name in the inbox.
    Overdue after counts from when the task is created.
    People, A role, A field on the record or Smart Script decide who gets the task.
    Everyone listed sees the task. The first person to decide completes 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.

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.

The Task Space in App space: counters for open, delayed, in progress and completed tasks, and a table of tasks with priority, due date and status.
    The counters show open and overdue tasks at a glance.
    One row per task. The title is what you typed in the approval step.
    The due date counts from the task’s creation, using Overdue after.
    Show my team inbox lists tasks assigned to a role.

Overdue after marks a task as overdue in the inbox. For a reminder, build a scheduled workflow.

  1. On Payment Requests, create a workflow named Daily approval reminder. Choose Adhoc as the trigger.
  2. Turn on Also run on a schedule and choose Every day at 09:00. Check Next runs under it.
  3. Add Load data. Choose Payment Requests, match Status is Pending Manager or Pending Finance, sort by oldest first, and name the list waiting.
  4. 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.

Prepare a Word template under Document generation with placeholders such as ${request_number} and ${amount}, and a bookmark where the signature goes. Then:

  1. On Payment Requests, create an Adhoc workflow named Issue approval letter.
  2. 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.
  3. Tick Also put it in a file field and choose Approval letter.
  4. 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.

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.

ProfileSetting
RequestersCreate and view Payment Requests. Team records off, so each sees only their own
ManagersTeam records on, so a manager sees requests created by their team
FinanceAll records. Edit on Approver signature
ApproversA 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.

  • 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.

The Solutions page follows one request from capture to finance: Approvals and requests.

Check yourself

Sara adds two people under Who decides? on an approval step. What happens when the task is created?
Show the answer

Both see the task, and the first to decide completes it. The step says it itself. Everyone listed sees the task, and the first person to decide completes it. For two decisions, chain two approval steps.

Karim sets Overdue after to 2 days on the approval step. He also wants a morning reminder for slow approvals. What does he build?
Show the answer

A scheduled workflow that loads the waiting requests and sends an email. Overdue after marks the task as overdue in the inbox. A scheduled workflow loads what is still waiting and sends the reminder.

What's next

Last checked