Rules
Calculated totals
The seating total is the indoor seats plus the outdoor seats. Asking people to add them up invites mistakes.
calculate works a number out from others in the same section. It shows read-only, updates as people type, appears in the review, and is sent to the API.
{
key: "total_seats",
type: "number",
label: "Total seats",
calculate: { sum: ["indoor_seats", "outdoor_seats"] },
},
Add it, type the indoor and outdoor seats, and watch the total follow. Open the Payload tab: total_seats is there with the rest. Open Answers: there it stays null, because a calculated number is never stored, so it cannot go stale.
A sum counts the parts answered so far; { product: ["length", "width"] } multiplies, and waits for every part.