Writing and Using Smart Form Formulas

Modified on Mon, 17 Nov at 11:50 AM

Overview

Formulas in Smart Forms allow you to calculate values, control field visibility, and automate workflows within projects.

This article explains where formulas are used, how to create them, and the different types of function fields.


Where Formulas Are Used

Formulas can appear in several areas of Smart Forms:

LocationPurpose
Calculated FieldsPerform calculations or combine field data.
Visibility FormulasControl whether a field or page is visible.
Editability FormulasControl whether a field can be edited.
Workflow ConditionsDecide what happens next in a workflow based on field values.


Smart Form Function Field Types

Each Smart Form “Function” field type must return a specific value type:

Function FieldMust ReturnTypical Use
Text FunctionText (string)Combine or format text fields.
Numeric FunctionNumberPerform calculations between fields.
Checkbox FunctionBoolean (true/false)Create logic tests or conditions.
Dropdown List FunctionID of a dropdown optionOutput selected dropdown item.
Date FunctionDateReturn or manipulate a date value.


Example: Creating a Text Function Field

  1. Add a Text Function field to your Smart Form.
  2. In the formula editor, combine two project variables: 
  3. Save and recalc the page.


Visibility and Editability Formulas

Formulas can determine who can see or edit a field.


Example 1: Restrict access to Admins only

Displays the field or page only if the current user is an Admin.


Example 2: Show a field only for specific project types


Baseline Values

You can reference historical field values using baseline prefixes.

PrefixApplies ToDescription
FPV / ID / KAFirst approved baseline
LPV / ID / KALast approved baseline
SPV / ID / KAFirst approved user baseline
TPV / ID / KALast approved user baseline
YPV / ID / KAFirst approved system baseline
ZPV / ID / KALast approved system baseline

To get a baseline value, replace the leading letter(s) of the live variable with the appropriate baseline prefix shown above (e.g., PV2FV2 or LV2; ID22FD22 or LD22).

 

System Constants

System constants store reusable values, such as color codes or image IDs.

They help avoid repeating the same value across multiple formulas.

They are accessed under Administration > Smart Forms > System Constants and Images


Common Operators and Functions

TypeExamplesNotes
LogicalAND, OR, NOTUsed in conditions.
Arithmetic+, -, *, /+ also joins text strings.
ConditionalIF(condition, true, false)Core syntax used most often.
Null HandlingISNULL(ID19, 0)Prevents errors from empty fields.
String FunctionsLEN(), TRIM(), SUBSTRING()Manipulate text.



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