Using expressions

Published on: July 3, 2024
Edited on: December 19, 2024

In various parts of eformity, expressions can be used. Expressions consist of different components. In this article, we will cover everything about different expressions.

A

AsText

=Variables.AsText("Name")

Description

AsText returns the text value of a variable. This is absolute.

Parameters

NameTypeDescription
NameStringEnter the name of the variable.

AsValue

=Variables.AsValue("Name")

Description

AsValue returns the value of a specific variable. This is absolute.

Parameters

NameTypeDescription
NameStringEnter the name of the variable.

C

Choose

=Variables.Choose("Gender", "M;F", "Mr.;Mrs.", "Mr./Mrs.")

Description

Looks up a value in a list.

Parameters

NameTypeDescription
NameStringEnter the name of the variable.
Lookup valuesString Value to be searched for, separated by a semicolon.
Lookup valuesString Values returned if found in the lookup value. Separated by a semicolon.
Lookup valuesString Returned if the value is not found.

Contains

=Variables.Contains("Test")
=Variables.Contains("Test", "as")

Description

Checks if a variable exists.

Parameters

NameTypeDescription
NameStringEnter the name of the variable.
Value (optional)String Enter the value you want to search within the variable value.

E

Endwith

=Variables.EndWith("Name", "Value")

Description

Ensures a value always ends with the specified value.

Parameters

NameTypeDescription
NameStringEnter the name of the variable.
Value (optional)String Enter the value to end the variable value with.

F

Format

=Variables.Format("Name", "", "{0}", "nl-nl")

Description

Formats a variable.

Parameters

NameTypeDescription
NameStringEnter the name of the variable.
Default valueString Value if the variable is not found.
FormattingStringThe formatting of the variable.
Language (optional)StringFormat language.

G

GetValue

=Variables.GetValue("Name", "")

Description

Returns the value of a specific variable. This is relative.

Parameters

NameTypeDescription
NameStringReturns the value of a specific variable. This is relative.
Default valueString Returned if the variable is not found.

GetText

=Variables.GetText("Name")

Description

Returns the text value of a variable. This is relative.

Parameters

NameTypeDescription
NameStringVariable name

H

HasValue

=Variables.HasValue("Name")

Description

Checks if the variable has a value.

Parameters

NameTypeDescription
NameStringVariable name
Values (optional)StringList of possible values separated by a comma or semicolon.

I

IsAnyOf

=Variables.IsAnyOf("Name", "Value1;Value2")

Description

Checks if the value is one of the values in the list.

Parameters

NameTypeDescription
NameStringVariable name
ValuesStringList of possible values separated by a comma or semicolon.

IsEqual

=Variables.IsEqual("Name", "Motor")

Description

Compares if the variable is equal to the value.

Parameters

NameTypeDescription
NameStringVariable name
ValueStringValue to compare the variable with.

IsGreater

=Variables.IsGreater("Name", 5)

Description

Compares if the variable is greater than the value.

Parameters

NameTypeDescription
NameStringVariable name
ValueIntegerValue to compare the variable with.

IsGreaterOrEqual

=Variables.IsGreaterOrEqual("Name", 5)

Description

Compares if the variable is greater or equal to the value.

Parameters

NameTypeDescription
NameStringVariable name.
ValueIntegerValue to compare the variable with.

IsLess

=Variables.IsLess("Number", 5)

Description

Compares if the variable is less than the value.

Parameters

NameTypeDescription
NameStringVariable name.
ValueIntegerValue to compare the variable with.

IsLessOrEqual

=Variables.IsLessOrEqual("Name", 5)

Description

Compares if the variable is equal to or less than the value.

Parameters

NameTypeDescription
NameStringVariable name.
ValueIntegerValue to compare the variable with.

IsNotEqual

=Variables.IsNotEqual("Name", "Motor")

Description

Compares if the variable is not equal to the value.

Parameters

NameTypeDescription
NameStringVariable name.
ValueStringValue to compare the variable with.

IsNullOrEmpty

=Variables.IsNullOrEmpty("Name")

Description

Checks if the variable is an empty string.

Parameters

NameTypeDescription
NameStringVariable name.

IsValueOf

=Variables.IsValueOf("Name", "Value1")
=Variables.IsValueOf("Name", "Value1;Value2")	

Description

Checks if the variable's value matches any in the list of values.

Parameters

NameTypeDescription
NameStringVariable name.
ValuesStringList of possible values separated by a comma or semicolon.

J

Join

=Variables.Join("FirstName;MiddleName;LastName", ", ")

Description

Combines values using a separator (empty values are automatically skipped).

Parameters

NameTypeDescription
NamesStringNames of the variables separated by a semicolon (;).
SeparatorStringList of possible values separated by a comma or semicolon.
End separator (optional)StringSeparator for the last value.

JoinSelection

=Variables.JoinSelection("Checkbox1;Checkbox2;Checkbox3", "Value1;Value2;Value3", ", ")

Description

Combines values from a yes/no value using a separator (empty values are automatically skipped).

Parameters

NameTypeDescription
NamesStringNames of the variables separated by a semicolon (;).
ValuesStringValues separated by a semicolon (;).
SeparatorStringSeparator for combining the values.
End separator (optional)StringSeparator for the last value.

L

Left

=Variables.Left("Name", 5)

Description

Extracts the leftmost characters from a variable value.

Parameters

NameTypeDescription
NameStringVariable name.
LengthIntegerNumber of characters to extract.

Length

=Variables.Length("Name")

Description

Returns the length of a variable's value.

Parameters

NameTypeDescription
NameStringVariable name.

P

PadLeft

=Variables.PadLeft("Name", 10)

Description

Pads the text to the specified number of characters from the left.

Parameters

NameTypeDescription
NameStringVariable name.
NumberIntegerNumber of characters to pad to.

PadRight

=Variables.PadRight("Name", 10)

Description

Pads the text to the specified number of characters from the right.

Parameters

NameTypeDescription
NameStringVariable name.
NumberIntegerNumber of characters to pad to.

R

Replace

=Variables.Replace("CompanyName", "Eformity", "eformity")

Description

Finds and replaces text in a variable.

Parameters

NameTypeDescription
NameStringVariable name.
Search forStringText to search for.
Replace withStringText to replace found text with.

Right

=Variables.Right("Name", 5)

Description

Extracts the rightmost characters from a variable value.

Parameters

NameTypeDescription
NameStringVariable name.
LengthIntegerNumber of characters to extract.

Round

=Variables.Round("Name", 2)

Description

The Round function rounds a variable to the specified number of decimal places.

Parameters

NameTypeDescription
NameStringThe name of the variable to be rounded.
Decimal placesIntegerThe number of decimal places to round to.

S

StartsWith

=Variables.StartsWith("Name", "Value")

Description

Checks if the variable value starts with the specified value.

Parameters

NameTypeDescription
NameStringVariable name.
ValueStringValue to check for.

Substring

=Variables.Substring("Name", 0, 5)

Description

Extracts a substring from a variable value.

Parameters

NameTypeDescription
NameStringVariable name.
IndexIntegerStarting index.
LengthIntegerNumber of characters to extract.

T

ToBase64

=Variables.ToBase64("Name")

Description

Encodes the variable value to Base64.

Parameters

NameTypeDescription
NameStringVariable name.

ToLower

=Variables.ToLower("Name")

Description

Converts the variable value to lowercase.

Parameters

NameTypeDescription
NameStringVariable name.

ToUpper

=Variables.ToUpper("Name")

Description

Converts the variable value to uppercase.

Parameters

NameTypeDescription
NameStringVariable name.

Trim

=Variables.Trim("Name")

Description

Trims spaces from the variable value.

Parameters

NameTypeDescription
NameStringVariable name.

TrimEnd

=Variables.TrimEnd("Name")

Description

Trims spaces from the end of the variable value.

Parameters

NameTypeDescription
NameStringVariable name.

TrimStart

=Variables.TrimStart("Name")

Description

Trims spaces from the start of the variable value.

Parameters

NameTypeDescription
NameStringVariable name.