Minimum and maximum values

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Define Forms > Form Controls > Control properties >

Minimum and maximum values

It is a common requirement to validate a numeric input against a minimum and/or maximum value; specifically, in Bizagi, for the Number, Money or Date controls.
To accommodate this need, Bizagi provides Minimum and Maximum properties.

 

The Minimum and Maximum value properties are found in the Advanced tab of the control's Properties.

 

For these properties, the values can be set by entering text, selecting a value or associating an expression. The value, set by any of these methods, will display in the property's description area.

 

MinimumandMaximumValue6

 

If the end user input does not fall within the range of minimum and maximum boundary values, a validation will display.

 

note_pin

Keep in mind that the type of value returned in the expression must coincide with the type of value that the control manages (e.g dates with dates, integer with integer). If they are different, errors may occur in the execution of the form.

 

note_pin

If you are using an expression, its name will be displayed on the left. If the name is too long to fit in the box, hover with the mouse, a tooltip with the complete name will display.

ControlsProperties27

 

Example:  Define minimum and maximum boundary values for a Money Control

In a Credit Request Process the amount to be requested must be at least a 100 US dollars. Also, the maximum amount allowed is ten times the monthly income of the applicant.

 

In the Credit Request Process Entity, the Monthly income and the Requested Amount property values are stored in the attributes with the same name.

 

MinimumandMaximumValue5

 

1. In the Forms Designer, go to the Requested Amount control Properties and open the Advanced tab.

 

MinimumandMaximumValue1

 

2. In the Minimum property type the value of 100.

 

MinimumandMaximumValue2

 

 

3. Select the Maximum property and click the expression icon (FormsComponents151) in order to associate an expression.

 

MinimumandMaximumValue3

 

 

4. In the expression module define the maximum threshold based on the monthly income.

 

The expression in this example would be: <CreditRequest.MonthlyIncome>*10;

 

MinimumandMaximumValue4

 

Save the expression and close the Form.

 

5. Proceed to test your validations in the Work Portal.

Enter a value lower than a 100 in the Requested Amount Control. When clicking Next, a validation message will display, as shown in the image below.

 

MinimumandMaximumValue7

 

 

Now enter a value higher than ten times the monthly income of the applicant. When clicking Next, the following message will display as shown in the image below.

 

MinimumandMaximumValue15

 

 

 

Example: Define minimum and maximum boundary values for the Date Control

In a Vacation Leave Request Process an employee must request the vacations at least 15 days in advance. In addition, a stipulation exist whereby requests submitted after December 30th (2012) will not be processed.

 

The official working day on which the vacation commences is stored in the attribute Leaving Date, within the Vacation Request Process Entity.

 

MinimumandMaximumValue12

 

1. In the Forms Designer, select the Properties of the Leaving Date control and open the Advanced tab.

 

MinimumandMaximumValue8

 

2. In the Maximum property select the December 30th entry from the calender.

 

MinimumandMaximumValue9

 

3.  Select the Minimum property and click the expression icon (FormsComponents151) in order to associate an expression.

 

MinimumandMaximumValue10

 

4. In the expression module define the minimum value allowed (15 days in advance) according to the current date.

 

The expression in this example would be:

 

var Today=DateTime.Today;

var Max=Today.AddDays(15)

Max;

 

MinimumandMaximumValue11

 

Save the expression and close the form.

 

5. Go to the Work Portal to test the validations. Try to enter a date after December 30th. Note that this cannot be done as all days that fall after the boundary date are disabled (in this example the 31st). In addition, the next month icon (FormsComponents153) is disabled.

 

MinimumandMaximumValue13

 

 

Now try to enter a date between today and two weeks thereafter (suppose the current day is 5/05/2016). Again, note it is not possible.

 

 

MinimumandMaximumValue14

 

Related Articles

Minimum value using expressions

Maximum value using expressions


Last Updated 1/6/2022 11:23:35 AM