Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents

...

Overview

The Visual Rules Builder enables non-technical designers to add dynamic behaviors to a form/workflow. Here are several behaviors that you can create:

  • Show/Hide a Control(s) based on a specified condition
  • Show/Hide Steps in a workflow based on the step that the workflow is currently executing
  • Dynamically setting default values and control properties such as valid, printable, required and more.
  • Compute a Subtotal and Total

  • Populate fields with the logged in user’s information

  • Concatenate field data

  • Populate a Date field when the user signs

and much more....

Image Modified

Tip
 W

Watch this webinar for an overview of how to create dynamic forms/workflows without writing code.

Column
width240px

 On this page:

Table of Contents
maxLevel1

When Do Rules Execute

Business Rules are executed under the following conditions:

...

When the rule displays in the Rule Builder tab, it will indicate that the rule has been flagged to run only when the form loads, if this checkbox is checked.

Rule Builder Wizards

The Rule frevvo Rule Builder walks you through three easy steps to define your condition and actions.

Condition

...

Wizard

Describe the conditions under which a set of actions should be executed. You can specify more than one condition in the same rule but you do not need a condition.

Each condition consists of the following:

 PartDescriptionExample
Field or current step (Optional)

What field or current workflow step do you want to evaluate?


Select a field in your form, such as 'FirstName'.

Image Added

OperatorWhat condition do you want to test to see if it is true?
Select to from the choices to use an expression or function in your rule
 

Select an operator such as "is filled".

Image Added

Value (Optional)

What value do you want to compare the Field or current step to?

What function/operator do you want to use to build the expression?

Let's say you select "Current Step" and "is" for the first two parts. Now select the step from the list shown:

Image Added

The left side Field and right side Value must be of a matching type. For example, you cannot use numeric expressions with text controls. If you've selected an incompatible value type, Help Mode will show an error to help you correct it.

Note

When you use the VRB "contains" condition on a checkbox control, you must set the literal value to the full, exact option value. On radio and dropdown controls, partial values work, but since the Checkbox value is an array, the rule is looking for the entire option value in the array and cannot find any partial value.

For example, checkbox "C" has options "Option_1", "Option_2", "Option_3". If you use the VRB rule When C contains "1", it always evaluates to false. If you change the condition to When C contains "Option_1" the rule works as expected.

Built In Functions

The Visual Rule Builder (VRB) provides the following functions, no code required! The tables below explain each function. However, when you are using the Visual Rule Builder, you can also see these summaries, parameters, and an example of how to use the function as you type in and select the function. In use, function names are followed by parenthesis, which contain the comma-separated parameter(s) of the function. For example, if you want to add two fields using the sum function, enter sum(<controlname1>,<controlname2>). The VRB will guide you to this syntax and let you know if there are any syntax errors. Function names may be entered in any case (case insensitive).

Code Block
titleVRB Function syntax
sum(price_1, price_2)

...

Action Wizard 

Declare the actions that should be taken when the condition is true. Similar to the Condition Wizard above, the wizard has three parts: Field, Operator, and Value. Functions and Operators can also be selected as the value in this wizard. Only relevant operators will be shown based on the selected field.

Here's an example that sets the TotalDue control to the sum of the Amount controls (a table column) minus the CashAdvance control.

Image Added

Else Action Wizard

Declare the actions that should be taken when the condition is false. Similar to the Condition Wizard above, the wizard has three parts: Field, Operator, and Value. Functions and Operators can also be selected as the value in this wizard. Only relevant operators will be shown based on the selected field. Else Actions are optional as not all rules require them. You cannot add FALSE actions if you do not have a condition specified in the rule.

In this example, we've set a condition that checks to see if the PeriodTo date is before the PeriodFrom date. If that is true, it sets the PeriodTo control to invalid. If that condition is FALSE, it sets PeriodTo to valid.

Image Added

Image Added

Built In Functions


The Visual Rule Builder (VRB) provides the following functions, no code required!



User Details Functions

Used to retrieve the user's manager's user ID
Tip

Refer to the Visual Rule Builder chapter or watch this 6-minute video for an overview of how to create dynamic forms/workflows without writing code.

Expand
titleClick here to see the available Built-In Functions
FunctionSummaryParameters
userFirstNameUsed to retrieve the user's first name for the current user or for a specific userId. Returns the first name string.

userId - The optional userId of the user to get the first name for. This parameter an be any text expression. If not supplied, then this function returns the first name for the current logged in user.

userLastNameUsed to retrieve the user's last name for the current user or for a specific userId. Returns the last name string.userId - The optional userId of the user to get the last name for. This parameter an be any text expression. If not supplied, then this function returns the last name for the current logged in user.
userFullNameUsed to retrieve the user's full name for the current user or for a specific userId. Returns the full name string.userId - The optional userId of the user to get the full name for. This parameter an be any text expression. If not supplied, then this function returns the full name for the current logged in user.
userEmailUsed to retrieve the user's email for the current user or for a specific userId. Returns the email string.

userId - The optional userId of the user to get the email for. This parameter an be any text expression. If not supplied, then this function returns the email for the current logged in user.

userIDUsed to retrieve the userID for the current user or for a specific userId. Returns the id string.userId - The optional userId of the user to get the id for (typically not used). This parameter an be any text expression. If not supplied, then this function returns the id for the current logged in user.
userManagerID

Functions are entered into the Enter an Expression field in the wizards.

Image Added

This field has two modes:

  • Lookup Mode
  • Help Mode

Lookup Mode

Lookup mode displays functions and controls from your form/workflow. The functions matching the typed text are displayed first followed by the form/workflow controls.

Lookup Mode is triggered as you enter text in the Value fields of the wizards.

Image Added

Help Mode

Help mode shows help text for the function in the dropdown area. The help information includes:

  • function syntax
  • summary info about the function
  • an example
  • parameter information.

Image Added

Note
  • Expressions must have the same value type as the control. For example, the functions hour and minute are only available on Time controls. If there is a type discrepancy, the designer will see an error like this:

Image Added

  • DateTime controls are meant to represent a point in time and therefor do not support the functions Year, Month, Day, Hour, or Minute.
  • Message controls cannot be used in the expression field, even if they have Save Value checked. To set the value of another control to a message control's value, switch to Rule Code.

Functions Available

The tables below explain each function. When you are using the Visual Rule Builder, you can see the functions' summaries, parameters, and an example of how to use the function as you type in and select the function. In use, function names are followed by parenthesis, which contain the comma-separated parameter(s) of the function. For example, if you want to add two fields using the sum function, enter sum(<controlname1>,<controlname2>). The VRB will guide you to this syntax and let you know if there are any syntax errors. Function names may be entered in any case (case insensitive).

Code Block
titleVRB Function syntax
sum(price_1, price_2)

When referencing repeat controls and tables, you only need to use the child control name (i.e. the column control name) in the VRB. frevvo takes care of looping through the repeat/table for you.

User Details Functions

FunctionSummaryParameters
userFirstNameUsed to retrieve the user's first name for the current user or for a specific userId. Returns the

...

first name string.

userId -

...

The optional userId of the user to get the

...

first name for. This parameter

...

can be any text expression. If not supplied, then this function returns the

...

first name for the current logged in user.

...

userLastNameUsed

...

Text and Boolean Functions 

...

  • str - The text to check the prefix of. May be control name, string literal, etc.
  • prefix - The prefix text. May be control name, string literal, etc.

...

  • str - The text to check the suffix of. May be control name, string literal, etc.
  • suffix - The suffix text. May be control name, string literal, etc.

...

  • str - The text to check if the tokenStr is within. May be control name, string literal, etc.
  • tokenStr - The text to search for. May be control name, string literal, etc.

...

  • str - The text to get a substring from, may be null or a control name as well.
  • separator - The text to search for, may be null or a control name as well.

...

  • str - The text to get a substring from, may be null or a control name as well.
  • separator - The text to search for, may be null or a control name as well.

...

  • str - The text to get a substring from, may be null or a control name as well.
  • open - The text before the substring, may be null or a control name as well.
  • close - The text after the substring, may be null or a control name as well.

...

  • expr1 - A control or expression.
  • expr2 - The second control or expression value to be appended to the first.
  • expr3 - Optional additional controls or expression(s).

Math and Numeric Functions

...

  • expr1 - A control or expression. May contain repeating and/or non-repeating controls.
  • expr2 - Optional additional controls or expression(s). May contain repeating control or non-repeating control values.

...

  • expr1 - A numerical expression. May involve repeating control or non-repeating control values.
  • expr2 - Optional additional numerical expression(s). May involve repeating control or non-repeating control values.

...

to retrieve the user's last name for the current user or for a specific userId. Returns the last name string.userId - The optional userId of the user to get the last name for. This parameter can be any text expression. If not supplied, then this function returns the last name for the current logged in user.
userFullNameUsed to retrieve the user's full name for the current user or for a specific userId. Returns the full name string.userId - The optional userId of the user to get the full name for. This parameter can be any text expression. If not supplied, then this function returns the full name for the current logged in user.
userEmailUsed to retrieve the user's email for the current user or for a specific userId. Returns the email string.

userId - The optional userId of the user to get the email for. This parameter can be any text expression. If not supplied, then this function returns the email for the current logged in user.

userIDUsed to retrieve the userID for the current user or for a specific userId. Returns the id string.userId - The optional userId of the user to get the id for (typically not used). This parameter can be any text expression. If not supplied, then this function returns the id for the current logged in user.
userManagerIDUsed to retrieve the user's manager's user ID for the current user or for a specific userId. Returns the manager user id string.userId - The optional userId of the user to get the user's manager's user ID for. This parameter can be any text expression. If not supplied, then this function returns the user's manager's user ID for the current logged in user.
userDetailUsed retrieve individual information fields for the currently logged in user. These fields can either be one of the standard fields or a custom field configured using the (ldap) security provider.fieldName - The name of the user information property to retrieve. This parameter can be any text expression. The standard properties are 'id', 'first.name', 'last.name', 'email' and 'reports.to'.


Text and Boolean Functions

FunctionSummaryParameters
isFilledUsed to determine if a field (control) has a value. Returns true if the field has a value.fieldName - The field/control to check for a value.
isEmptyUsed to determine if a field (control) does NOT have a value (i.e. it is not filled). Returns true if the field has no value.fieldName - The field/control to be checked for no value.
textStartsWithTests if this string starts with the specified prefix. Returns true if the prefix parameter is a prefix of the str parameter; false otherwise.
  • str - The text to check the prefix of. May be control name, string literal, etc.
  • prefix - The prefix text. May be control name, string literal, etc.
textEndsWithTests if this string ends with the specified suffix. Returns true if the suffix parameter is a suffix of the str parameter; false otherwise.
  • str - The text to check the suffix of. May be control name, string literal, etc.
  • suffix - The suffix text. May be control name, string literal, etc.
textContainsReturns true if and only if str contains the specified tokenStr.
  • str - The text to check if the tokenStr is within. May be control name, string literal, etc.
  • tokenStr - The text to search for. May be control name, string literal, etc.
textBeforeGets the substring before the first occurrence of a separator. The separator is not returned. textBefore('tim@example.com', '@') = 'tim'.
  • str - The text to get a substring from, may be null or a control name as well.
  • separator - The text to search for, may be null or a control name as well.
textAfterGets the substring after the first occurrence of a separator. The separator is not returned. textAfter('tim@example.com', '@') = 'example.com'.
  • str - The text to get a substring from, may be null or a control name as well.
  • separator - The text to search for, may be null or a control name as well.
textBetweenGets the String that is nested in between two Strings. Only the first match is returned. The open and close strings are not included. textBetween('tim@example.com', '@', '.com') = 'example'.
  • str - The text to get a substring from, may be null or a control name as well.
  • open - The text before the substring, may be null or a control name as well.
  • close - The text after the substring, may be null or a control name as well.
concatReturns the text concatenation of a set of expressions.
  • expr1 - A control or expression.
  • expr2 - The second control or expression value to be appended to the first.
  • expr3 - Optional additional controls or expression(s).

Math and Numeric Functions

FunctionSummaryParameters
sumReturns the sum of a set of numerical items represented by the input parameters. Parameters are expressions that may contain repeating and/or non-repeating controls.
  • expr1 - A control or expression. May contain repeating and/or non-repeating controls.
  • expr2 -

...

  •  Optional additional controls or expression(s). May contain repeating control or non-repeating control values.

...

averageReturns the

...

average of a set of numeric expressions.
  • expr1 - A numerical expression. May involve repeating control or non-repeating control values.
  • expr2 - Optional additional numerical expression(s). May involve repeating control or non-repeating control values.
minimumReturns the minimum value of a set of numerical items represented by the input parameters. Parameters are expressions that may contain repeating and/or non-repeating controls.
  • expr1 - A control or expression. May contain repeating and/or non-repeating controls.
  • expr2 -

...

  • Optional additional controls or expression(s). May contain repeating control or non-repeating control values.

...

maximumReturns the

...

maximum value of a set of

...

numerical items represented by the input parameters. Parameters are expressions that may contain repeating and/or non-repeating controls.
  • expr1 - A control or expression.

...

  • May contain repeating and/or non-repeating controls.
  • expr2 - Optional additional controls or expression(s). May

...

  • contain repeating control or non-repeating control values.

...

countReturns the

...

count of

...

items in a

...

control

...

  • expr - The name of a repeating control.
  • filterExpr - A required boolean filter expression parameter used to determine if each repeating item is included in the calculation. May include operators, functions, literal values and/or non-repeating controls or repeating controls at the same level.

...

, typically a repeating control, but will accept non-repeating controls.
  • expr1 - A control or expression. Typically a repeating control, but will accept non-repeating controls.
  • expr2 - Optional additional controls or expression(s). May involve repeating control or non-repeating control values.
sumifReturns the sum of a set of numerical items in a repeating control. Takes a boolean filter expression parameter used to determine if each repeating item is included in the calculation.
  • expr -

...

  •  The name of a repeating control.
  • filterExpr - A required boolean filter expression parameter used to determine if each repeating item is included in the calculation. May include operators, functions, literal values and/or non-repeating controls or repeating controls at the same level.

...

averageifReturns the

...

average of a

...

repeating control's values. Takes a boolean filter expression parameter used to determine if each repeating item is included in the calculation.
  • expr -

...

  • The name of a repeating control.
  • filterExpr - A required boolean filter expression parameter used to determine if each repeating item is included in the calculation. May include operators, functions, literal values and/or non-repeating controls or repeating controls at the same level.

...

minimumifReturns the

...

minimum value of a set of numerical items in a repeating control. Takes a boolean filter expression parameter used to determine if each repeating item is included in the calculation.
  • expr - The name of a repeating control.
  • filterExpr - A required boolean filter expression parameter used to determine if each repeating item is included in the calculation. May include operators, functions, literal values and/or non-repeating controls or repeating controls at the same level.

...

maximumifReturns the

...

maximum value of a set of numerical items

...

Date/Time Functions

...

  • year - The date's 4-digit year.
  • month - The date's month (1=January)
  • day - The day of the month.

...

  • hour - The hour of the day (0-23).
  • minute - The minutes (0-59).

...

in a repeating control. Takes a boolean filter expression parameter used to determine if each repeating item is included in the calculation.
  • expr - The name of a repeating control.
  • filterExpr - A required boolean filter expression parameter used to determine if each repeating item is included in the calculation. May include operators, functions, literal values and/or non-repeating controls or repeating controls at the same level.

...

  • num - The number that gets rounded.
  • decimalDigits - The number of decimal digits to round the number to.

...

countifReturns the count of items/values in a repeating control. Takes a boolean filter expression parameter used to determine if each repeating item is included in the calculation.
  • expr - The name of a repeating control.
  • filterExpr - A required boolean filter expression parameter used to determine if each repeating item is included in the calculation. May include operators, functions, literal values and/or non-repeating controls or repeating controls at the same level.
roundRounds a numeric value to the specified number of decimal digits using a "round half up" policy. The rounded value is returned.
  • num - The number that gets rounded.
  • decimalDigits - The number of decimal digits to round the number to.
truncateTruncates a decimal number to be an integer.num - The number that gets truncated to an integer.

Date/Time Functions

FunctionSummaryParameters
todayUsed to get the current date.N/A
dateUsed to create a date object.
  • year - The date's 4-digit year.
  • month - The date's month (1=January)
  • day - The day of the month.
timeUsed to create a time of day object.
  • hour - The hour of the day (0-23).
  • minute - The minutes (0-59).

...

timeofdayUsed to get the current

...

local time of day (hour and minute).N/A

...

datetimeUsed to

...

create a dateTime object

...

.

...

  • year - The 4-digit year.
  • month - The month (1=January)
  • day - The day of the month.
  • hour - The hour of the day (0-23).
  • minute - The minutes (0-59).
nowUsed to get the current date and time.N/A
yearUsed to get the

...

year from a date or dateTime object or control.date - The date or datetime to get the year from.
monthUsed to get the month (1-12) from a date or dateTime object or control.date - The date or datetime to get the month from.
dayUsed to get the day of the month (1-31) from a date or dateTime object or control.date - The date or datetime to get the day from.
hourUsed to get the hour from a time object or control.time - The time to get the hour from.
minuteUsed to get the minute from a time object or control.time - The time to get the minute from.
daysBetweenUsed to get the number of days between date1 and date2. If date1 is earlier that date2, then the result is 0 or positive; otherwise 0 or negative.
  • date1 - The first date or date-time.
  • date2 - The second date or date-time.
monthsBetweenUsed to get the number of months between date1 and date2. If date1 is earlier that date2, then the result is 0 or positive; otherwise 0 or negative.
  • date1 - The first date or date-time.
  • date2 - The second date or date-time.
yearsBetweenUsed to get the number of years between date1 and date2. If date1 is earlier that date2, then the result is 0 or positive; otherwise 0 or negative.
  • date1 - The first date or date-time.
  • date2 - The second date or date-time.

...

Functions are entered into the Enter an Expression field in the wizards.

Image Removed

This field has two modes:

  • Lookup Mode
  • Help Mode

Lookup Mode

Lookup mode displays functions and controls from your form/workflow. The functions matching the typed text are displayed first followed by the form/workflow controls.

...

Help Mode

Help mode shows help text for the function in the dropdown area. The help information includes:

  • function syntax
  • summary info about the function
  • an example
  • parameter information.

Image Removed

Note
  • Expressions must have the same value type as the control. For example, the functions hour and minute are only available on Time controls. If there is a type discrepancy, the designer will see an error like this:

Image Removed

  • DateTime controls are meant to represent a point in time and therefor do not support the functions Year, Month, Day, Hour, or Minute.
  • Message controls cannot be used in the expression field, even if they have Save Value checked. To set the value of another control to a message control's value, switch to Rule Code.

Operators

Use the Operators listed below to build the rule expression.

OperatorNamePurposeExample
+Addition

Operators

Use the Operators listed below to build the rule expression.

OperatorNamePurposeExample
+AdditionAdd two numeric sub-expressionsa + b
-SubtractionSubtract two numeric sub-expressionsa - b
*MultiplicationMultiply two numeric sub-expressionsa * b
/DivisionDivide two numeric sub-expressionsa / b
+ConcatenationConcatenate two text sub-expressions (Javascript only - for VRB use concat() function)firstName + " " + lastName
andLogical ANDLogically AND two boolean sub-expressionsisRetired AND isCollecting SS
orLogical ORLogically OR two boolean sub-expressionsisOnVacation OR isOnSickLeave
==EqualityCompare two sub-expressions for equalitya == b
!=InequalityCompare two sub-expressions for inequalitya != b
>Greater thanCompare two sub-expressions for greater thana > b
>=Greater than or equalCompare two sub-expressions for greater than or equala >= b
<Less thanCompare two sub-expressions for less thana < b
<=Less than or equalCompare two sub-expressions for less than or equala <= b

...

Info

In versions prior to v9.1, the '+' operator was used for both addition and concatenation. With the v9.1 upgrade, any '+' operators used for concatenation will be automatically updated to use the concat() function. Designers should use the concat() function for concatenation of text strings, and the '+' operator only for addition of numeric values. Using the , any '+' operator operators used for concatenation will return an error prompting the designer be automatically updated to use the concat() instead.

Info

Rules can still be written by manually adding JavaScript in order to build any degree of complex & powerful business logic and integrate with all of your Web Services and frevvo connectors.

Action wizard 

Declare the actions that should be taken when the condition is true. The Functions/Operators listed above can also be selected as the value in this wizard.

Else Action wizard

...

function. Designers should use the concat() function for concatenation of text strings, and the '+' operator only for addition of numeric values. Using the '+' operator for concatenation will return an error prompting the designer to use concat() instead.


Info

Rules can still be written by manually adding JavaScript in order to build any degree of complex & powerful business logic and integrate with all of your Web Services and frevvo connectors.

Add A Rule

  1. Click the Run Builder button.
  2. Click the Add Condition button to create a new condition (optional).
  3. Select your Field or select current step to describe an action that will execute based on the workflow step currently executing.
  4. Select the Action from the dropdown.
  5. Select the Value, expression or function(optional).  To enter a text value, slide the toggle switch icon to the right and a field displays to the right.

    Info

    If current step is selected as the condition for a workflow designed using Linked Steps, the value dropdown displays the names of the linked steps as choices. Workflows designed with individual forms as steps (not linked) will only show that step in the current step value dropdown.

    For example,

    • If you have one form (named form A) in a workflow, you will only see form A listed in the current step value dropdown,
    • If you add  2 linked steps (named form B and form C), the current step value dropdown lists all 3 steps: form A, form B and form C.
    • If you add form D (not linked) to the workflow, form D will not be listed in the current step value dropdown for form A


  6. Click Next to advance to the Action wizard Wizard.
  7. Specify the actions to be taken if the condition is true.
  8. Click Next to advance to the Else Action wizard Wizard
  9. Specify the actions to be taken if the condition is false.
  10. Click Finish.
  11. Save your form/workflow.
  12. Click the Save and Test icon  to verify that your rule is working as expected.

...

Multiple Conditions in a Rule

The Rule frevvo Rule Builder allows you to create a rule that has more than one condition. You can write a rule that performs actions based on the values of more than one field. As you select conditions, a logic expression is built and displayed at the bottom of the screen. Notice the expression uses the AND operation by default. There may be business rules that require a change to the logic expression.

...