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.
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
When You Want Each Variant
| Need | Use | Why |
|---|---|---|
| Total of multiple Data Table rows | Auto-totals: {d.<tableName>Totals.<col>} | Already automatic — no formula needed |
| Single value from one row of a Data Table | collection_aggregate | You want, e.g., "Dwelling Award RCV" pulled from the Coverage A row |
| Sum of separate scalar Custom Fields | field_aggregate | Inputs are individual fields, not rows in a table |
| Minimum, maximum, or average of fields | field_aggregate with that aggregation | Same as sum but with a different operator |
| Count of how many fields are filled | field_aggregate with count | Useful 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:
Create the source fields first
For example, three currency fields: deductible, aleAllowance, mortgageHoldback. These are normal Custom Fields you fill per appraisal.
Create the totaling field
New Custom Field. Name: totalCredits. Field type: Currency.
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.
Pick the aggregation
Sum, Minimum, Maximum, Average, or Count. For most totaling cases, leave it on Sum.
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.
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
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
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
Worked Example: Total Credits
- Settings → Custom Fields. Create three currency fields with no formulas: deductible, aleAllowance, mortgageHoldback.
- Assign all three to the Appraisal Report template (Settings → Document Templates → your template → Custom Fields).
- 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.
- 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)".
- In the Word template, reference {d.custom.totalCredits} wherever you want the total. Generate the PDF — the value is $8,600.
Aggregations Reference
| Aggregation | Behavior | Source Field Types |
|---|---|---|
| sum | Adds every non-empty value | currency, number |
| min | Smallest non-empty value | currency, number |
| max | Largest non-empty value | currency, number |
| avg | Mean of non-empty values | currency, number |
| count | Number of fields with a non-empty value | any field type |
Strict numeric handling
Related Articles
Data Tables: Repeating Sections in Your Templates
Define per-appraisal tables (comparison rows, weather events, roof slopes) that loop in your Word templates with auto-totaled currency columns.
Narrative Snippets: Reusable Boilerplate Prose
Define reusable paragraph templates with embedded tokens. Write the boilerplate once, fill it per appraisal, ship it in any number of Word templates.
Master Templates: One Template, Many Variations
Build one Word template with every possible section, then enable only the relevant ones per appraisal. Disabled sections drop out of the rendered PDF.