Affiliate disclosure. I may earn a commission or receive a referral reward when you sign up or buy through the links marked Affiliate.

In this article
  1. Set the question for your prototype
  2. A small rule for the routing preview
  3. Test what the interface tells the reviewer
  4. What changes before you connect a real system

Set the question for your prototype

Can an approver find the right request, understand its next step and recover from a missing owner? Compare what users do with a fixture that contains a clear decision, a rejected request and a record whose owner is missing. This walkthrough uses WeWeb's documented visual workflows and custom JavaScript action. The data and outputs below are illustrative. They are deliberately small enough to review by eye.

WeWeb for the interface and workflow

Visit WeWeb (affiliate link)

Create a page with a repeating list, a detail panel and a routing preview. Add a project variable for the currently selected request. Bind the detail panel to the selected row and show an empty state before a row is chosen. A useful fixture has an ID, status, currency, amount in cents, whether the requester supplied the required evidence, and an owner role. Fix the currency to USD for this exercise. Add a record that contains an unsupported currency and decide what the page should display.

Start the list with three statuses: ready for review, needs evidence and closed. Label the result with words visitors can understand. An action named “Review routing” is clearer when it opens a preview rather than immediately changing a record. In the button’s workflow, add a Custom JavaScript action. Use the editor to insert the selected request where the example currently sets a fixture, and bind the action result to the routing label or to a subsequent action.

A small rule for the routing preview

The function returns an object that the interface can display. USD 5,000 is an arbitrary threshold chosen for the exercise. Amounts in cents keep the comparison straightforward. The preview sends invalid amounts and missing evidence to manual review. Closed records get their own state.

function routeRequest(request) {
  if (request.status === "closed") {
    return { state: "closed", owner: null }
  }

  const { amountCents, currency, evidenceComplete } = request
  if (currency !== "USD" || !Number.isSafeInteger(amountCents) ||
      amountCents < 0 || evidenceComplete !== true) {
    return { state: "needs_review", owner: "operations" }
  }

  const owner = amountCents >= 500000 ? "finance" : "team_lead"
  return { state: "ready", owner }
}

const sample = {
  status: "open",
  currency: "USD",
  amountCents: 500000,
  evidenceComplete: true
}

return routeRequest(sample)

Test what the interface tells the reviewer

Run the fixture at 499,999 and 500,000 cents. The owner should change from team lead to finance at the boundary. Pass a missing amount, a negative amount and incomplete evidence, then verify that each produces the manual review state. Close the same request and confirm the interface stops offering the open-request actions. Where the rule returns an owner role with nobody assigned, show “Finance owner needed” and give the reviewer a clear route to resolve it.

Ask a teammate who has never seen the prototype to pick the item that should move today. Pause when they hesitate and ask what information they expected to see. A person repeatedly opening each row to find the reason is a signal to show the reason in the list. Record the misread and the exact state of the row. That makes the next version easier to test against the same example.

What changes before you connect a real system

Move permission checks and authoritative routing to the backend. The UI preview helps someone understand the next step, while the server must determine who can change a request. Carry a record version to detect concurrent edits. Keep an audit event for the previous status, the new status, the actor and the decision time. Verify these controls with separate accounts before adding financial records, personal data or a production payment action.

Something here sounds like your workplace?
Define the use case, connect approved systems and test a bounded workflow before expanding it.

Discuss an AI integration ↗

Email Daniil ↗ · +420 774 552 597