Back to Reports & Documents

Computed Defaults: Auto-Fill Custom Fields

Make a custom field auto-compute its value from a Data Table cell or by aggregating other custom fields. The user can still type a value to override.

Advanced11 min readUpdated 2026-05-03

You have three currency Custom Fields on every appraisal: deductible, ALE allowance, and mortgage holdback. Your invoice template needs a "Total Credits" line that is just those three added together. Today you do the math on a calculator and type the total into a fourth field, hoping you got it right.

A Computed Default attaches a formula to that fourth field so AwardLettr does the math. You stop adding columns by hand. The user can still type a value to override on a specific case, but the default behavior is automatic. This is an advanced feature for power users who are building out heavy custom-field setups, but the time it saves on every case compounds.

This article covers when to use computed defaults vs. Data Table totals vs. filter expressions, the two formula variants (field aggregation and collection aggregation), and a worked example for the most common case of summing scalar fields.

Two flavors

collection_aggregate pulls a value from a single row of a Data Table (e.g. "the awardRcv for Coverage A"). field_aggregate sums/averages/min/max/counts across other Custom Fields (e.g. "Total Credits = deductible + ALE + holdback"). Pick based on whether your source data is in a table or split across separate fields.

When You Want Each Variant

NeedUseWhy
Total of multiple Data Table rowsAuto-totals: {d.<tableName>Totals.<col>}Already automatic — no formula needed
Single value from one row of a Data Tablecollection_aggregateYou want, e.g., "Dwelling Award RCV" pulled from the Coverage A row
Sum of separate scalar Custom Fieldsfield_aggregateInputs are individual fields, not rows in a table
Minimum, maximum, or average of fieldsfield_aggregate with that aggregationSame as sum but with a different operator
Count of how many fields are filledfield_aggregate with countUseful for completeness checks

Setting Up field_aggregate via the Dashboard

The simpler variant — sum (or min/max/avg/count) across other Custom Fields — has a UI in Settings → Custom Fields. Here's the flow:

1

Create the source fields first

For example, three currency fields: deductible, aleAllowance, mortgageHoldback. These are normal Custom Fields you fill per appraisal.

2

Create the totaling field

New Custom Field. Name: totalCredits. Field type: Currency.

3

Tick "Auto-fill from other custom fields"

This option only appears for currency or number field types. The form expands to show aggregation and source-field controls.

4

Pick the aggregation

Sum, Minimum, Maximum, Average, or Count. For most totaling cases, leave it on Sum.

5

Tick the source fields

Check deductible, aleAllowance, mortgageHoldback. The list filters to compatible field types — currency/number for sum/min/max/avg, all types for count.

6

Save

On the appraisal page, the totalCredits field shows a live preview of the computed value as you type into the source fields. At PDF render time, the same value flows into {d.custom.totalCredits}.

Editing or Removing a Formula

Open the field in Settings → Custom Fields and click Edit. The Auto-fill section reflects the current formula. Toggle off the checkbox to clear the formula, or change the aggregation/source fields to reshape it.

No-op edits don't destroy formulas

Opening a field in edit and clicking Save without touching the auto-fill controls leaves any existing formula untouched. The formula only changes when you actually interact with the auto-fill section.

Live Preview on the Appraisal Page

Below a totaling field on the Report Details tab, you'll see a blue hint that updates as you type into the source fields:

Auto-fills as $8,600 (sum of deductible, aleAllowance, mortgageHoldback). Type a value to override.

When you generate a PDF from any template that references {d.custom.totalCredits}, AwardLettr re-runs the same formula server-side and substitutes the result. You don't need to "save" the computed value — it's recomputed every time.

collection_aggregate: Pulling from a Data Table

The other variant — pulling a single value out of a Data Table — currently only has API/SQL authoring. The use case: you want a Custom Field that always shows "the awardRcv for Coverage A" as a stand-alone scalar token.

Often a filter expression is enough

Before reaching for a collection_aggregate Custom Field, check whether {d.<tableName>[where <col>='<val>'].<col>} (a filter expression) directly in your template or a snippet body solves the problem. Custom Fields are most useful when the same value appears across many places and you want a stable token name.

Chained Computeds (Aggregator of Aggregators)

A field_aggregate can reference another computed field. AwardLettr resolves them in dependency order at render time, so a "grand total" field summing two "subtotal" fields works correctly regardless of display order.

Cycles are detected and skipped

If field A depends on field B which depends on field A, both fields stay unresolved at render time and the cycle is logged in the server output. Avoid building circular dependencies — they don't error, but they also don't produce values.

Worked Example: Total Credits

  1. Settings → Custom Fields. Create three currency fields with no formulas: deductible, aleAllowance, mortgageHoldback.
  2. Assign all three to the Appraisal Report template (Settings → Document Templates → your template → Custom Fields).
  3. Create a fourth currency field: name totalCredits, label Total Credits. Tick Auto-fill, leave aggregation on Sum, tick the three source fields. Save and assign to the template too.
  4. Open any appraisal's Report Details tab. Type 5000 into Deductible, 2400 into ALE Allowance, 1200 into Mortgage Holdback. The Total Credits hint reads "Auto-fills as $8,600 (sum of deductible, aleAllowance, mortgageHoldback)".
  5. In the Word template, reference {d.custom.totalCredits} wherever you want the total. Generate the PDF — the value is $8,600.

Aggregations Reference

AggregationBehaviorSource Field Types
sumAdds every non-empty valuecurrency, number
minSmallest non-empty valuecurrency, number
maxLargest non-empty valuecurrency, number
avgMean of non-empty valuescurrency, number
countNumber of fields with a non-empty valueany field type

Strict numeric handling

sum/min/max/avg fail loudly if any source field has a non-numeric value — the formula returns null instead of silently coercing to zero. This prevents subtle wrong totals when a field that should be currency contains stray text. Empty fields are skipped without affecting the result.
Suggest an editLast updated 2026-05-03
Computed Defaults: Auto-Fill Custom Fields | AwardLettr Docs