Introduction to expressions and formulas

Updated 1 week ago by Neil

Expressions are used in Kissflow to create formulas and settings for fields and steps. 

The importance of data types

Expressions in Kissflow are strongly typed to the data type you are working with. Functions, methods, fields, and operators will only work with the correct data type. If you have trouble with an expression, always start with examining the data type. 

Every field type is associated with a particular data type.

Data type

Field types

Example output

Text

Text, TextArea, Dropdown

Stark Industries

Number

Number, Rating, Slider

3,000

Currency

Currency

$10,000

Date

Date

May 29, 1970 

Datetime

Datetime

May 29, 1970 3:30pm

Boolean (i.e. true/false)

Yes/No

TRUE

User

User

Reference

Lookup

List{text}

Multi-select/Checkbox

“Operations”,”Sales”,”Marketing”

List{user}

Multi select user

Notes: 

  • Aggregation fields can be either a text, number, or a list.
  • Remote Lookup fields will be either text or JSON.
  • There are no data types associated with image, attachment, rich text, or signature fields. You cannot use these fields in expressions. 

Detailed expression tips based on data type

Because expressions are so connected to the data type, we’ve separated the instructions for creating expressions based on the data type. 

 

Parts of an expression

Expressions can be made up of fields, functions, methods, and operators. 

Fields

You can use any field on your form that has a data type associated with it. When using a field, you must use the field ID in the expression.

You can also use system fields that Kissflow automatically collects data about. 

Functions and methods

Functions and methods allow you to act on data. A function comes first in an expression, whereas a method is called up after mentioning the field. 

Every function has a specified number of parameters associated with it. For example, with an IF function, there are three parameters: the condition you are testing for, the value you display if it is true, and the value you display if it is false.

IF(Order_total>5000, ”Yes”, ”No”)

Every function requires braces after it to tell the system that you want to use that function, even if there are no parameters to include. For example, if you want to show the current date, you must type TODAY(). 

Operators

An operator is used to show how different parts of the expression should be evaluated or connected. You can see a list of available operators depending on the field type you select.

Where can I use expressions?

1. Form field formulas

You can use expressions as a part of a formula for calculating a field in your form. Form fields can display all data types except for Boolean.  

2. Step conditions

You can use an expression to determine when a workflow step or branch happens. 

These expressions must be Boolean. If the result is TRUE, the step or branch will happen. If it is FALSE, the step is skipped. 

3. Assigning a user to a step

You can use an expression to assign a step to a user. 

These expressions must result in a User data type.

4. Deadline times and messages

You can use an expression to define how many hours until a step crosses a deadline. 

This expression must be either a number or datetime data type. 

You can also use an expression to define whom a notification or escalation message is sent to when a deadline is crossed. 

This must be a user data type. 


How did we do?