Using the Formula and Condition Editor

Previous  Home topic  Next  Print this topic Send Feedback

Many forms can benefit from the use of a formula or a condition. Formulas and conditions can be assigned to form fields, buttons, other objects and even events.

 


Interactive Example IconInteractive Example  

For a demonstration of formulas and calculations, see the Date and Time Calculations Example (available only in the online version of this help guide).


 

The most common use of a formula is the Set Field behavior command which allows you to assign a formula to a form field.

 

The most common locations for conditions are:

 

Simple Branch behavior (true/false If condition)
Multiple Branch behavior (multiple If conditions)
Workflow diagram stage transition

 

The general use of the editor is the same for formulas and conditions. On the left side is the main compose area. Each line can contain:

 

A text or number value, date, state, value of a field or special value.
An operator (+,-,/,*)
A function (see the Functions table for a complete list)

 

When the editor loads, the main area will contain a single line with <empty> in it. You can change this line by selecting a value on the right.

 

Text or number - Whatever literal value you enter here will be used in the line.
Date - Allows you to specify a literal date.
State - Allows you to set a field to be true (checked) or false (unchecked) by default.
Field - Points to a specific form field which is then inserted on the line.
Special - Gives access to a list of special codes or form properties.

 

The following are some common tasks you might want to complete in the editor:

 

Adding Lines

To add a new line, click Add Line. A new operator and a new field line are displayed. You can then change the field from <empty> to your requirements. You can also change the operator if the default + is not appropriate.

 

Removing Lines

Click the delete Delete Button button to remove a line.

 

Adding Parentheses

If you need to build more advanced mathematical expressions, use parentheses buttons to add these to an expression. Use the Add() button to surround the selected line with parentheses.

 

Reordering Lines

You can move a line up and down the list by selecting the line and then clicking the up and down arrows.

 

Copy, Paste or Delete

Use CTRL+C, CTRL+V or contextual menus (right mouse click) to copy, paste or delete selected sections.

Certain restrictions apply; see below.

 

 

 Copy, Paste or Delete restrictions

 

Any operand, function or a group of operands, operators and functions can be copied
Operators on their own cannot be copied
Copy applies to the currently marked selection (blue area)
Copy is either by CTRL+C or by context menu (mouse right-click)
Paste is either by CTRL+V or by context menu
Delete is by context menu
Cut is not supported
Paste is possible within same formula or in other formula
Paste is not possible within a function parameter
Paste occurs at position of the current selection. Copied content is inserted into formula and current selection moves down.
Copy & Paste is not possible between Reporting Formulas and Scripting Formulas.
Pasting of a single operand (without operator) automatically inserts an addition (+) operator.

Updated: 20/01/2012  Page url: http://www.perfectforms.com/Documentation/manual/html/?formula_and_condition_intro.htm
PerfectForms™ -- forms software, workflow software, and business process management