How to Create and Use Formulas in Forms Made Easy

Forms Made Easy allows you to create formulas for General Fields in the Form Builder. Formulas automatically calculate values based on information entered into other fields, helping you perform calculations, combine text, apply conditions, and work with dates and times.


You can use the Formula Editor to insert fields, operators, and supported functions, or write your formula directly. You can also check the formula syntax before saving it.


Before you start

  1. Formulas can only be added to general fields (fields you added from the general field list). Fields mapped to a Salesforce object can't hold a formula.
  2. The field must not be required. If the field is marked required, the formula option is hidden.
  3. These field types can hold a formula: Text, Number, Currency, Percent, Date, DateTime, Time, Email, Checkbox, Rich Text Area, Picklist, Textarea, Tel, Single Select Group and Multi Select Group.
  4. File Upload, Live Photo, Signature, Payment, Rating, Video, Image, Terms and Conditions, and Display Text fields can't hold a formula.
  5. Add the fields your formula will use to the canvas first. The editor only lets you reference fields that are on the form.


Step-by-step


Step 1: Select the field that will hold the formula


Open your form in the Form Builder and click the field on the canvas. Its settings panel opens.



Step 2: Open the Formula Editor


In the settings panel, click the Formula Editor button. The Formula Editor window opens. Under the title, you'll see the field name and the type of value it expects.



Step 3: Insert fields


Use the Insert Field dropdown ("Select a Field...") to add a field reference at the cursor. Each option shows the field label, its name, and its type. The list does not show the field you're editing or fields that already have a formula of their own.



Step 4: Insert operators


Use the Insert Operator dropdown ("Select an Operator...") to add an operator. The available operators are:

  • + (Add) and - (Subtract): for numbers. They also work with dates: a date plus or minus a number gives a date, and one date minus another gives the number of days between them.
  • Multiply, / (Divide) and % (Modulo): numbers only. Multiply is the asterisk symbol.
  • & (Concatenate): joins text, for example {First Name} & " " & {Last Name}. Use & rather than + to join text.
  • = (Equal) and != (Not Equal): compare any two values.
  • <, >, <= and >=: compare numbers, dates, date/times or times.



Step 5: Insert functions


Use the Insert Function dropdown ("Select a Function...") to add a function. It's inserted with placeholder argument names, for example, IF(logical_test, value_if_true, value_if_false). Replace the placeholders with your own fields and values.


Supported functions, by group:

  • Logical: IF, AND, OR, NOT, CASE, ISBLANK, ISNULL, ISNUMBER, BLANKVALUE, NULLVALUE, ISPICKVAL, INCLUDES
  • Text: UPPER, LOWER, LEN, TRIM, CONTAINS, BEGINS, LEFT, RIGHT, MID, FIND, SUBSTITUTE, LPAD, RPAD, VALUE, TEXT, REGEX, HYPERLINK, IMAGE, BR, HTMLENCODE, JSENCODE, JSINHTMLENCODE, URLENCODE
  • Math: ROUND, ABS, CEILING, FLOOR, MCEILING, MFLOOR, EXP, LN, LOG, SQRT, MOD, MAX, MIN
  • Date and time: TODAY, NOW, DATE, ADDMONTHS, DATEVALUE, DATETIMEVALUE, TIMEVALUE, TIMENOW, DAY, MONTH, YEAR, WEEKDAY, DAYOFYEAR, ISOWEEK, ISOYEAR, HOUR, MINUTE, SECOND, MILLISECOND, UNIXTIMESTAMP, FORMATDURATION



Step 6: Type or adjust the formula

  • You can also type straight into the Formula Expression box. A few rules:
  • Wrap every field reference in curly braces, like {Salary}.
  • Put text values in double quotes, like "Approved". Single quotes are not accepted.
  • You can use numbers, TRUE, FALSE, and null as values.
  • A formula can be up to 1,000 characters.



Step 7: Click Check Syntax

Click Check Syntax. The editor checks your field references, brackets, operators, function arguments, and whether the result matches the type of the field. A message appears beside the button:

  • Green: "No syntax errors in merge fields or functions. (Compiled size: N characters)".
  • Red: an error starting with "Error:" that explains what to fix.



Step 8: Save the formula

Click Save Formula. The button is only enabled once the formula has passed Check Syntax (the formula is checked again when you save). You'll see "Formula saved successfully.", and the field becomes read-only on the form. In the settings panel, the button now reads Edit Formula.



How to check it works

  1. Preview or open the published form.
  2. Fill in the fields used by the formula (for example, Salary and EMI).
  3. Check that the calculated field updates on its own and can't be typed into.


Editing or removing a formula

To change a formula, select the field and click Edit Formula. To remove it, open the editor, click Clear, then click Save Formula with the box empty. You'll see "Formula cleared successfully", and the field becomes a normal field again.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article