TrustPager Docs

← Help Center

Content

Calculated results: figures worked out instantly in gifts and quizzes

Add figures to a gift or scorecard quiz that are worked out instantly from what each person answers (stamp duty, a deposit, a repayment), with formulas and rate tables, no AI and no credits. Includes calculator-only gifts.

Calculated results let a gift or a quiz work out figures for each person the moment they answer: stamp duty, a deposit, a loan-to-value percentage, a repayment. You write each figure once, as a name and a formula over the questions you ask. The figures appear instantly, cost no credits and use no AI, so they are the same every time for the same answers.

You set them up in a gift at https://app.trustpager.com/operations/gifts and in a scorecard quiz at https://app.trustpager.com/operations/quizzes. Open the gift or quiz and choose Calculated results in the list on the left. (In a gift it sits in the What it makes group. A test with right and wrong answers has no number questions, so use a scorecard.)

What people see

Under the heading Your figures each figure shows with its name, for example "Stamp duty: $31,490". Money shows in your workspace's currency, following your workspace's country (an Australian workspace shows dollars the Australian way). A figure that cannot be worked out shows Not available instead of a wrong number. That happens when a formula divides by zero, when a question they needed was skipped, when no rate table row fits their answer (for example a state you did not list), or when the result would be too large.

The figures are worked out again by TrustPager from their answers every time, so nobody can change a figure by editing the page.

Set one up

  1. Ask for the numbers. Add a question and set its Answer type to A number. Choose Shown as: A plain number, An amount of money ($) or A percentage (%). Optionally set Lowest, Highest and Step (how far one tap of the arrow moves it). An answer outside the lowest and highest is refused on their page, with the range shown. A money question shows your currency symbol beside the box. A percentage is typed as 6 for 6%, so write rate / 100 in a formula.
  2. Check each question's key. Every question has a Key for calculated results, the short name a formula uses, like price. Leave it empty and TrustPager makes one from the question. A key is lower case letters, digits and underscores, starts with a letter and is up to 40 characters. In the Calculated results section, Your answers, by key lists every key: click one to copy it.
  3. Add a result. Choose Add a result. Fill in Name people see, the Formula, Shown as (Number, Money ($) or Percent (%)) and a Key, which lets a later formula use this result.
  4. Add rate tables if you need them (see below).
  5. Try it. The preview on the right is headed Try it: type some answers. Type answers and the figures appear underneath, worked out the way a person's page works them out. Nothing is saved and it costs nothing.
  6. Go live. A gift can go live with only calculated results. See the end of this article.

It all saves by itself once it is valid. If something is wrong, an amber Not saved yet note says what to fix in plain words, and the last good version stays in use, so nobody ever sees a half-written formula.

Writing a formula

A formula is written like one in a spreadsheet, using the keys of your questions and results.

Functions you can use:

How each kind of answer reaches a formula:

Examples:

A formula can use the key of another result, so you can build a figure in steps. A formula that cannot make sense (for example adding words to a number) is not saved, and the note tells you which result to fix.

Rate tables

A rate table holds rates a formula looks up. In the Calculated results section, below Results, choose Add tiered amounts or Add a value per answer. A window opens, with a Table name (lower case letters, digits and underscores, like nsw_duty), which is how formulas refer to it. Choose Done when finished, or Remove this table.

Tiered amounts (brackets)

For rates that change as the amount grows, such as stamp duty. The window is titled Rate table: tiered amounts, with one row for each tier:

For an amount inside a tier, the result is the amount already owed at the start of the tier, plus the rate for each $1 above where the tier starts. Choose Add a tier to add one.

Example (made-up rates, to show the idea only): tier 1 from 0 up to 100,000, owed 0, rate 1%. Tier 2 from 100,000 up to 500,000, already owed 1,000, rate 2%. Tier 3 from 500,000 and above, already owed 9,000, rate 3%. A price of 600,000 gives 9,000 plus 3% of the 100,000 above 500,000, which is 12,000. The formula is brackets(my_duty, price). Use the real rates for your state or product.

A value for each answer (lookup)

For a value that depends on a choice, such as a rate for each state. The window is titled Rate table: a value for each answer, with two columns: When the answer is and The value is. Choose Add a row for each choice. Each key can appear once, and capital letters and spaces are ignored when matching.

The value is either a number, such as a surcharge rate (use it as lookup(surcharge_rate, state) * price), or the name of a tiered table. That lets one figure use a different tier table for each state:

brackets(lookup(duty_by_state, state), price)

Give lookup a third value to use when the answer is not listed, for example lookup(surcharge_rate, state, 0). Without it, an unlisted answer shows Not available.

Limits

The words and, or, not, true and false, and the function names above, cannot be used as keys or table names.

A calculator-only gift

A gift does not have to make a PDF, a picture or a video. If you switch nothing on under What it makes and add calculated results, it is a calculator-only gift. The builder says it makes "no files, only calculated results", and the person's figures appear the moment they answer, at no cost. Nothing to wait for, and it can be set to Live on its own. If a gift does make something as well, the figures appear first and the rest follows when it is ready.

Try a gift with Try it yourself in the gift builder. It makes a sample for a sample business and shows the figures at the top. The parts that make things are charged as a real gift, the figures are free.

Where people use them

More on each kind: https://trustpager.com/help-center/gifts-made-for-each-person and https://trustpager.com/help-center/quizzes.

Using your assistant instead

Everything here is also available to Evie, or to your own Claude connected through the TrustPager connector. It can set a gift's or quiz's calculated results (update_gift and update_quiz), and try answers without saving anything (calculate_gift and calculate_quiz). Gifts need the gifts permissions and quizzes the quizzes permissions. For exact tool and field names see https://docs.trustpager.com/reference#gifts and https://docs.trustpager.com/reference#quizzes.

If something looks wrong

Build it once in the Calculators library

Instead of writing figures inside each gift or quiz, you can build a calculator once in the library at https://app.trustpager.com/operations/calculators and link it. Publishing the calculator updates every gift, quiz and website calculator linked to it, and runs can be saved onto the contact's opportunity. The library has its own article: https://trustpager.com/help-center/calculators.

← Back to Help Center Open on trustpager.com ↗