RPA Connect
English
English
  • Form Design
    • Quick Start
      • Login to RPA Connect
      • Creating a Form
      • Workspace Environment
      • Designing a Basic Form
    • Property Assignment
      • General Properties
      • Appearance
      • Validations
        • Advanced Validations
      • Behavior
        • Advanced Behaviors
    • Comprehensive Form Development
      • Text and Numeric Fields
      • Date and Time Fields
      • Option Selection Fields
      • Other Input Fields
      • Tables
    • Using Common Resources
      • Resource Upload
      • Resource Utilization
    • Workflow Configuration
    • Advanced Options
  • Administration
    • Admin App
      • Accessing Admin App
      • User and Group Management
      • Workspaces
      • Roles and Permissions
    • Integration with Microsoft Entra ID
      • Synchronization Authorization
      • AD Group Management
      • Microsoft Teams Notification Configuration
  • BLUEPRISM
    • Connection with BluePrism
      • Creating an Authentication Credential
      • Generating a Public Form Instance
      • Querying Template Instances
      • Other Actions
        • Instance-Linked Actions
        • File-Linked Actions
        • Stage-Linked Actions
      • Additional Information
  • INTERACTION CHANNELS
    • Instance Management in Teams and the Portal
      • Interface and Common Functions
        • Home
        • Submissions
        • Inbox
      • Activity in Microsoft Teams
      • Portal Features
Powered by GitBook
On this page
  • Content Validations
  • Validation of Blank Fields
  • Validation of Blank Fields in a Table
  • Validation of Column Totals in a Table
  • Validation of Business Days Between Two Dates
  • Validation of Field Comparisons
  • Validation of Identical Values
  • Date Validation
  • Logical Operator Validation
  • NOT Operator
  • AND Operator
  • OR Operator
  1. Form Design
  2. Property Assignment
  3. Validations

Advanced Validations

PreviousValidationsNextBehavior

Last updated 5 months ago

The Validation Expressions section allows you to configure data logic validations, which are especially efficient for verifying that the value entered by the user in each field matches the expected data type. Its functionality consists of checking whether a specific condition is met.

If the condition is met and the result is true, an error message is displayed, and the user cannot submit the form until it is corrected. If the condition is false, no action will be taken, and the user can proceed with the process.

These types of validations can refer to the data entered in the field where they are defined (e.g., checking if it meets a specific length), in another field (e.g., showing an error in the "Quantity" field if the "Product" field is invalid), or by comparing data between two fields (e.g., checking if the start date for a given period is later than the end date).

Each expression consists of two values:

Value
Description

Message

The text to be displayed to the user to warn of the error when the validated condition is met, preventing the form from being submitted

Expression

The associated formula that will execute the validation for which the message is displayed

The Add Expression option in the top-right corner of the section allows you to include additional functions, enabling new fields for messages and expressions. This is useful for validating multiple conditions within the same field, such as ensuring a date falls within a specific period, is more recent than the date in another field, and is different from a third field. Applying multiple formulas with specific criteria allows for more precise control over the type of data accepted, helping to reduce the margin of error.

Below, we will analyze the following expressions in detail:

Function
Validation Type
Result

isEmpty(Field)

Content Validation

Returns true (error message) if a field is empty

count(Table)==0

Content Validation

Returns true if the rows in a table are empty

sum(Table,Column)!=N

Content Validation

Returns true if the total of a column is different from the allowed value

dateDifferenceInBusinessDays(Date1,Date2)<=N

Content Validation

Returns true if the number of business days is less than the rule allows

equal(Field1,Field2)

Comparison Validation

Returns true if two fields have the same value

smaller(Date1,Date2)

Comparison Validation

Returns true if the first date is earlier than the second

larger(Date1,Date2)

Comparison Validation

Returns true if the first date is later than the second

smallerEq(Date1,Date2)

Comparison Validation

Returns true if the first date is earlier than or equal to the second

largerEq(Date1,Date2)

Comparison Validation

Returns true if the first date is later than or equal to the second

not(Field)

Logical Operator Validation

Returns true if the field has a negative result

not(Expression)

Logical Operator Validation

Returns true if the expression has a negative result

and(Expression1,Expression2)

Logical Operator Validation

Returns true if both expressions are true

or(Expression1,Expression2)

Logical Operator Validation

Returns true if one of the two expressions is true

ConditionalExpression?TrueConditionExpression:FalseConditionExpression

Ternary Operator Validation

Returns the result of a second expression depending on whether the first condition is met

Keep in mind that formula components are enclosed in parentheses. The editor will display an error message if the number of open parentheses in the formula does not match the number of closed parentheses, helping you identify inconsistencies in more complex functions.

Content Validations

Certain formulas allow us to evaluate the validity of data based on whether the values entered meet specific characteristics established for that field, such as ensuring it is not blank or does not exceed certain limits. Let’s explore some of these and their functionality below.

Validation of Blank Fields

As we saw earlier, validation expressions allow us to enhance certain functionalities of our form, such as configuring required fields. Below, we will use the isEmpty() expression to define a field as mandatory and display a custom error message when the user attempts to submit it blank.

Select the "Last Name and First Name" field and set the Required property to False to disable it. Then, go to the Validation Expressions section.

In the Message field, write the text that will be displayed to the user if they do not complete the field, for example: "You must enter your first and last name."

Next, you will need to set the formula that controls this condition. Click the fx icon on the far right of the Expression field to open the editor and enter the formula:

isEmpty(last_name_first_name)

Whenever you add an expression, make sure to verify that the field names are written correctly, respecting uppercase and lowercase letters. The editor will display a warning if a field name is not present in the schema when an undeclared value is entered, but it cannot detect if you have written the name of another existing field instead.

Once you have added the expression, click Confirm to finish. If the condition is met, meaning the "Last Name and First Name" field is blank, the function will return the value true and display the message "You must enter your first and last name," preventing the user from submitting the form until this data is entered. Conversely, if the condition is not met because the field is complete, it will return the value false, and the user will be able to submit the form successfully.

This type of validation can also be applied to tables to verify if rows are loaded or to Attachment fields to check if a file has been attached. If no information is present, the formula will return the value true and display an error message.

Validation of Blank Fields in a Table

The count() formula is useful for counting the number of characters entered in a field and, when applied to a table, allows you to count the number of complete rows. To build a validation expression using this function, you can add an operator to return an error if the total equals zero.

count(Table)==0

Other simple operators can also be used to validate that the count is within the allowed limits:

Operator
Example
Validation

==

count(Table)==0

Returns true (error) if the total equals zero

!=

count(Table)!=100

Returns true if the total is not equal to 100

>

count(Table)>100

Returns true if the total is greater than 100

<

count(Table)<10

Returns true if the total is less than 10

Validation of Column Totals in a Table

The sum() function adds all the numbers within the range of a column to calculate a total. By adding operators to this function, it can be turned into a validation expression that compares the total against a preset number and returns an error when the entered data does not match the expected value. For example, in a sales table where the "percentage" column represents the portion of revenue for each product type, the sum of each cell should total 100.

The following function will detect if the total is different from 100 and display an error message if this condition is met:

sum(SalesTable,PercentageColumn)!=100

Validation of Business Days Between Two Dates

The dateDifferenceInBusinessDays() function calculates the total number of business days (Monday through Friday) between two dates. Similar to count(), adding an operator to the calculation allows it to be compared against a minimum or maximum value. For example:

dateDifferenceInBusinessDays(RequestDate,DeliveryDate)<=5

This formula will count the days between the request date and the delivery date, excluding weekends, and display an error message if the condition is true, i.e., if the period between the two dates is less than or equal to 5 days.

Validation of Field Comparisons

Other highly useful expressions are those that allow you to compare data entered in different fields in terms of similarity or difference between their values.

Validation of Identical Values

The equal() function checks both values (whether text, numbers, or dates) and returns true if they are identical, displaying an error message and preventing the instance from being submitted.

Using the form you’ve designed as a base, create a new Number field with the label "Mobile Phone" and the name "mobile_phone" in the "Contact Information" section.

To ensure that the number entered in this field is different from the one entered in the "Phone" field, you can use this validation expression. Click the fx icon on the far right of the Expression field and write the formula:

equal(phone,mobile_phone)

Next, press Confirm. If this condition is met, an alert will be displayed, which we will define in the Message field, for example: "The landline and mobile phone numbers cannot be the same."

A simpler alternative to this function can be constructed using operators for the comparison. For example, if you replace the equal() formula from the previous example with the expression phone==mobile_phone, the same validation will be performed, and you will get the same results.

Let’s look at the different types of operators you can use to compare data from two fields, along with an example of each and the action:

Operator
Expression
Example
Validation

==

Field1==Field2

FirstName==LastName

Checks if the fields are equal

!=

Field1!=Field2

Email!=ConfirmEmail

Checks if the fields are different

>

Field1>Field2

UnitsSold>Stock

Checks if the first field is greater than the second

<

Field1<Field2

Quantity<MinimumQuantity

Checks if the first field is less than the second

You can also combine the greater than (>) and less than (<) operators with the equal (=) operator for more specific results, e.g., RecommendedQuantity>=MaximumQuantity. In all these cases, meeting the condition will return the value true and display the error message entered in the Message property.

Date Validation

The smaller() function allows you to compare the dates entered in two fields and return an error message if the first is earlier than the second, for example, "The end date cannot be earlier than the start date." Its structure is as follows:

smaller(StartDate,EndDate)

Conversely, the larger() function checks if the first date is later than the second and returns an error message if this condition is met. Its structure is shown below:

larger(EndDate,StartDate)

There are variations for both expressions that also return an error message if the two dates are identical, i.e., applying the functionality of equal(). To do this, we need to modify the arguments of these functions as follows:

  • smallerEq (Date1,Date2): checks that the first date is earlier than or equal to the second

  • largerEq (Date1,Date2): checks that the first date is later than or equal to the second

These functions can also be used to compare other types of values, such as numbers or text strings.

Logical Operator Validation

Expressions based on AND, OR, and NOT operators allow validations based on the fulfillment of certain true/false conditions, either in the value of a field or expression (in the case of NOT) or in the result of two expressions applied to a field (AND and OR). Let’s explore each of these logical validations in detail.

NOT Operator

If the boolean is deactivated, i.e., if the response is negative, the expression will return an error message. For example, it can be applied to a boolean field named "Confirmation" to display an error message "You must accept the terms and conditions to continue" if the following expression returns true:

not(Confirmation)

More complex validations can also be performed by applying the not() expression to the evaluation of other functions, for example:

not(equal(Field1,Field2))

If the condition that fields 1 and 2 are equal is not met, an error message will be displayed. Remember that the editor will display an error message if the number of open parentheses in the formula does not match the number of closed parentheses.

AND Operator

With the and() expression, you can check the simultaneous fulfillment of two different expressions and display an error message when this occurs (i.e., when both return true), using the following logical check:

Expression1 Result
Expression2 Result
Result of and(Expression1,Expression2)

false

false

false

true

false

false

false

true

false

true

true

true

For example, if you have a form with two boolean fields where at least one must be activated, such as requesting a physical receipt or a virtual receipt, the and() function can be applied to display an error if both checkboxes are deactivated.

and(not(PhysicalReceipt),not(VirtualReceipt))

Let’s analyze how this expression works:

Expression1 Result
Expression2 Result
Result of and(Expression1,Expression2)

false: The user has requested a physical receipt

false: The user has requested a virtual receipt

false: No error message is displayed, as neither condition is met

true: The user has not requested a physical receipt

false: The user has requested a virtual receipt

false: No error message is displayed, as only one condition is met

false: The user has requested a physical receipt

true: The user has not requested a virtual receipt

false: No error message is displayed, as only one condition is met

true: The user has not requested a physical receipt

true: The user has not requested a virtual receipt

true: The error message is displayed because both conditions are met

More complex structures can be built for this type of validation by nesting other formulas with the AND operator within the field function to control a greater number of expressions:

and(Expression1,and(Expression1,Expression2))

In this way, the evaluation of expression 1 will return a true or false value that will be compared with the total true or false value returned by the second and() function when checking expressions 2 and 3. These functions can continue to be nested as long as the same structure is maintained.

OR Operator

The or() expression allows you to verify that at least one of two expressions is met and display an error message unless both return false, using this logical check:

Expression1 Result
Expression2 Result
Result of or(Expression1,Expression2)

false

false

false

true

false

true

false

true

true

true

true

true

The not() function returns true if the field has a negative value and is typically used for boolean fields, which act as a toggle that can be activated or deactivated based on a binary yes/no logic. We will explore this type of field in more detail later .

in this section
Validation Expressions section
Example of an error message when the entered expression is validated
Details of message and expression
Configuring multiple expressions for the same field with Add Expression
Alert for an error in the expression structure
Modifying the Required property
Edit Expression option
Applying the isEmpty() function to an Attachment field
Content validation in a table
Validation of the elapsed period between two dates
Alternative to the equal() expression using operators
Comparison between dates using the smaller() function
Comparison between dates using the larger() function
Applying the largerEq() expression
Validation of a boolean field
Checking for differences between values