Forms, fields and formulas

Avoid common errors in form field formulas

Tell functions from field IDs, match text exactly, and make the formula's result type match the field type.

Tip

Short answer: Most formula errors come from three things: mixing up a function with a field of the same name, text that doesn't match exactly, and a result type that doesn't match the field.

When to use this

Use this checklist when a computed field shows an error, an empty value, or a wrong result, or when Run is disabled in the formula builder.

Set it up

  1. Tell functions from fields. A field might be named Currency, Date or Number, which are also function names. Functions always have brackets, such as currency(), number() and date(). Fields are plain field IDs with no brackets and no quotes.
  2. Match text exactly. Text comparisons are case- and space-sensitive. If a formula checks for "NA" but the field holds "Not applicable", the check fails.
  3. Match the result type to the field. Each field type expects a data type. Don't compute a Number field with a text expression, or a Date field with a date-time expression. Convert first, for example with number() or .toText(). See the importance of data types.
  4. Test before you save. Click Evaluate, enter sample values, and click Run. Hover over the error to see what the builder expects. See computing fields using Formula builder.

Tip

Image, attachment, rich text and signature fields have no data type, so you can't use them in a formula.

Related answers