Formula
The Formula action A feature that supplies the instructions in a botflow. manipulates text, numbers and dates using functions.
Using the Formula action, you can create formulas in botflows A file that stores the actions and variables designed to automate tasks. for:
- Database fields.
- Variables.
Some examples of using the Formula action are, store a formula in a:
- List for use in a botflow.
- Variable for use in a botflow or applications.
- Database field for updating aggregate data.
Add a Formula action to a botflow
This example provides the steps necessary to add a Formula action to a botflow.
To add a Formula action to a botflow:
- On the Actions list, click Data and then click Formula from the Calculations list.
- Set the Formula settings.
- If needed, adjust the Run Error Task settings to fine tune how the action runs.
- If needed, adjust the Run Switch setting to create the action without running it.
- Optionally, add an action note.
- Click OK to add the Formula action to the botflow.
The Formula Action Builder window displays.
Functions|Formula: Select a formula function from the list of functions.
Save to: Type the path to where the formula will be saved, such as a list or variable.
Field or button | Description |
---|---|
Functions|Formula Options/Settings | Formula: These formula function descriptions are provided in these tables. Results
|
Run error task |
|
Note |
(Optional) Type a Note to document any special instructions or functionality.
|
Run Switch |
The Run Switch toggle controls how Nintex RPA runs an action when adding or editing an action in a botflow.
|
OK/Cancel | Click OK to save the action or click Cancel to discard the action or any changes. |
Important: All formula parameters, except for ConvertDateCulture and ConvertNumCulture, must be in US English format.
Tip: The Hold feature available in the Formula action and Formula section of the Expression Builder allows building nested formulas of up to 10 levels.
Build nested formulas using the Hold option
The Hold feature, available when building a formula using the Expression builder or the Formula action, can be used to place a formula on hold temporarily so that it can be nested within another formula. You can build up to 10 levels of nested formulas using the Hold feature.
To use the Hold feature:
-
Open the Expression Builder or the Action Builder window of the Formula action.
- Select the function you want, create a formula, and then click Hold to store the function.
- Start another formula, click the formula field you want to insert another formula in and click On Hold. The list of formulas you have placed on hold displays.
- Select the required On Hold formula you want to nest.
This is a list of conversion functions.
Function name | Description |
---|---|
CBool |
Returns an expression that has been converted to a boolean. |
CByte |
Returns an expression that has been converted to a byte. |
CCur |
Returns an expression that has been converted to currency. |
CDate |
Returns an expression that has been converted to a date. |
CDbl |
Returns an expression that has been converted to a double. |
CInt |
Returns an expression that has been converted to an integer. |
CLng |
Returns an expression that has been converted to a long. |
CSng |
Returns an expression that has been converted to a single. |
CStr |
Returns an expression that has been converted to a string. |
Hex |
Returns the hexadecimal value of a number. |
Oct |
Returns the octal value of a number. |
This is a list of date and time functions.
Function name | Description |
---|---|
Date |
Returns the current system date. |
DateAdd |
Returns a date to which a specified time interval has been added. |
DateDiff |
Returns the number of intervals between two dates. |
DatePart |
Returns the specified part of a given date. |
DateSerial |
Returns the date for a specified year, month, and day. |
DateValue |
Returns a date. |
Day |
Returns a number (1-31) representing the day of the month. |
DayZeroFilled |
Returns a zero-filled number (01-31) representing the day of the month. |
FormatDateTime |
Returns an expression formatted as a date or time. |
Hour |
Returns a number that represents the hour of the day (between 0 and 23). |
Minute |
Returns a whole number (between 0 and 59) representing the minute of the hour. |
Month |
Returns a number (1-12) representing the month of the year. |
MonthName |
Returns the name of a specified month. |
MonthZeroFilled |
Returns a zero-filled number (01-12) representing the month of the year. |
Now |
Returns the current system date and time. |
Second |
Returns a whole number (between 0 and 59) representing the second of the minute. |
Time |
Returns the current system time. |
TimeSerial |
Returns the time for a specific hour, minute, and second. |
Weekday |
Returns a whole number representing the day of the week (between 1 and 7). |
WeekdayName |
Returns the weekday name of a specified day of the week. |
Year |
Returns a number that represents the year. |
ZeroFillDate |
Returns a date in number format with each interval zero filled. |
This is a list of logic functions.
Function name | Description |
---|---|
And |
Returns True if all items evaluate as True. |
Contains |
Returns True if the provided value is found in the text. |
ContainsAlpha |
Returns True if the provided value contains an alpha character (A-Z or a-z). |
ContainsLCase |
Returns True if the provided value contains at least one lowercase character (a-z). |
ContainsNumber |
Returns True if the provided value contains at least one uppercase character (A-Z). |
ContainsUCase |
Returns True if the provided value contains at least one uppercase character (A-Z). |
False |
Returns the logical value False. |
If |
Checks whether a condition is met, and returns one value if True, and another value if False. |
IsBlank |
Returns True if the provided value is empty (no characters or spaces). |
IsBlankOrSpaces |
Returns True if the provided value is empty or contains only spaces. |
IsDate |
Returns True if the provided value is a Date. |
IsEqual |
Returns True if Item A and Item B are equal. |
IsEven |
Returns True if the provided value is an even number. |
IsGreater |
Returns True if Item A is greater than Item B. Non-numeric values are compared as Text. |
IsGreaterOrEqual |
Returns True if Item A is greater than or equal to Item B. Non-numeric values are compared as Text. |
IsLCase |
Returns True if all alpha characters in the provided value are lowercase. |
IsLess |
Returns True if Item A is less than Item B. Non-numeric values are compared as Text. |
IsLessOrEqual |
Returns True if Item A is less than or equal to Item B. Non-numeric values are compared as Text. |
IsNegative |
Returns True if the provided value is less than zero. Non-numeric values will return False. |
IsNotEqual |
Returns True if Item A and Item B are not equal. |
IsNumeric |
Returns True if the provided value is a number. |
IsOdd |
Returns True if the provided value is an odd number. |
IsPositive |
Returns True if the provided value is greater than or equal to zero. Non-numeric values will return False. |
IsProper |
Returns True if the provided value is proper cased. |
IsQuoteWrapped |
Returns True if the provided value is quote wrapped. |
IsSpaces |
Returns True if the provided value contains one or more space characters only. |
IsUCase |
Returns True if all alpha characters in the provided value are uppercase. |
IsWeekDay |
Returns True if the provided value is a week day (Mon-Fri). |
IsWeekendDay |
Returns True if the provided value is a weekend day (Sat-Sun). |
IsWholeNumber |
Returns True if the provided value is a whole number. |
IsZero |
Returns True if the provided value is zero. |
None |
Returns True if all items are False. |
Not |
Changes False to True, or True to False. |
Or |
Returns True if one or more items evaluate as True. |
True |
Returns the logical value True. |
This is a list of math functions.
Function name | Description |
---|---|
Abs |
Returns the absolute value of a number. |
Add |
Returns the sum of 2 or more numbers. |
Atn |
Returns the arctangent of a specified number. |
Average |
Returns the average mean of the provided numbers. |
Cos |
Returns the cosine of an angle. |
Divide |
Returns the quotient of two or more numbers. |
Exp |
Returns e (the base of natural logarithms) raised to a power. |
FormatCurrency |
Returns an expression formatted as a currency value using the currency symbol defined in the system control panel. |
FormatNumber |
Returns an expression formatted as a number. |
FormatPercent |
Returns an expression formatted as a percentage. |
Int |
Returns the integer part of a specified number. |
Log |
Returns the natural logarithm of a number. |
Max |
Returns the largest of the provided numbers. |
Median |
Sorts the provided numbers from smallest to largest and returns the middle value. |
Min |
Returns the smallest of the provided numbers. |
Multiply |
Returns the product of two or more numbers. |
Pi |
Returns the ratio of the circumference of a circle to its diameter. |
Power |
Returns a number raised to the specified power. |
Range |
Returns the difference between the highest and lowest numbers provided. |
Remainder |
Returns the remainder of the quotient of two numbers. |
Rnd |
Returns a random number less than 1 but greater than or equal to 0. |
Round |
Returns a number rounded to a specified number of decimal places. |
RoundDown |
Returns a number rounded down to a specified number of decimal places. |
RoundUp |
Returns a number rounded up to a specified number of decimal places. |
Sgn |
Returns an integer indicating the sign of a number. |
Sin |
Returns the sine of an angle. |
Sqr |
Returns the square root of a number. |
Subtract |
Returns the difference of two or more numbers. |
Tan |
Returns the tangent of an angle. |
ZeroFill |
Returns a string filled with 0 to a certain length. |
This is a list of text functions.
Function name | Description |
---|---|
Asc |
Returns the ANSI character code corresponding to the first letter in a string. |
Between |
Returns the text found between two values. |
BetweenRev |
Working backwards, returns the text found between two values. |
Chr |
Returns the character associated with the specific ANSI character code. |
Clean |
Removes all hidden and non-printable characters that prevent a formula from evaluating properly. |
Drop |
Drops a specific number of characters from the beginning or end of a string. |
InStr |
Returns the position of the first occurrence of one string within another. The search begins at the first character of the string. |
InStrRev |
Returns the position of the first occurrence of one string within another. The search begins at the last character of the string. |
IsAlpha |
Returns True if all characters in the provided value are alpha characters (A-Z, a-z, or space). |
IsAlphaNumeric |
Returns True if all characters in the provided value are alphanumeric characters (A-Z, a-z, 0-9, or space). |
Join |
Joins items together to form a line of text. |
LCase |
Converts text to lowercase. |
Left |
Returns a specified number of characters from the left side of a string. |
LeftOf |
Returns the text to the left of a specified value. |
Len |
Returns the number of characters in a string. |
LTrim |
Removes spaces on the left side of a string. |
Mid |
Returns a specified number of characters from a string. |
PadText |
Pads an expression with the specified character. |
Proper |
Capitalizes the first letter in each word. All other characters are converted to lowercase. |
QuoteWrap |
Returns the original text wrapped in quotes. |
Remove |
Removes all specified type of characters from a string. |
Replace |
Replaces a specified part of a string with another string a specified number of times. |
Right |
Returns a specified number of characters from the right side of a string. |
RightOf |
Returns the text to the right of a specified value. |
RTrim |
Removes spaces on the right side of a string. |
Space |
Returns a string consisting of the specified number of spaces. |
StrComp |
Returns a value indicating the result of a string comparison. |
String |
Returns a string of a specified length containing a repeating character. |
StrReverse |
Reverses a string. |
Trim |
Returns a copy of a string without the leading or trailing spaces. |
UCase |
Returns a string that has been converted to uppercase. |
WordCount |
Returns the number of words in a value. |
This is a list of translation functions.
Function name | Description |
---|---|
ConvertDateCulture |
Takes a date format from one country and converts it to the format used by another country. Supports:
Note: ConvertDateCulture can't be used as the parameter of another formula unless the convert to culture is in English (US). |
ConvertNumCulture |
Takes a number format from one country and converts it to the format used by another country. Supports:
Note: ConvertNumCulture can't be used as the parameter of another formula unless the convert to culture is in English (US). |
StateAbbrev |
Takes a full state name and returns the state abbreviation (USA only). |
StateName |
Takes a state abbreviation and returns the full state name (USA only). |