Constraints
Last updated
Last updated
This section provides options for limiting input values, setting default values, and configuring field validation.
Here you can specify the minimum and maximum values that can be entered into the columns. Any values outside of this range are not permitted. These limits can be applied to the input types: Number, Decimal, Date Time, and Date.
Consider the example below, where the minimum and maximum values are set for the 'Salary' column.
The existing values remain unchanged. However if a user enters a salary that falls outside the specified range, they will be notified of the minimum and maximum limits.
Note: You can also set any one of these limits (either minimum or maximum).
For Date and DateTime input types, users may choose a date range or both date and time range. Any date and time outside of this range will not be accepted.
This option is available for the Text input type, where you can specify whether to allow only numeric, alphanumeric, non-numeric, Email ID, or URL inputs. You can also specify a regex pattern to allow inputs that match a specific pattern. Inputs that do not match the pattern are flagged and rejected.
This ensures data correctness and accuracy.
The field value is validated against your specified input type configuration. If another type is entered, it is not accepted.
When you choose the 'Regex' option, a new field appears with the link 'Click to configure'.
After clicking the link, a pop-up appears where you can enter the regex pattern to be validated against. Click Apply and Save. In the example below, we have entered the regex text to validate the email ID or URL entered by the users.
When a user enters an incorrect email address or URL, the below prompt appears, and the input is rejected.
EDITable lets you configure default values for the columns. When a new row is added, the specified column is automatically filled with the default value if you have set one.
To set a default value, click the highlighted option below, beside the required column.
To set a static value, select Manual and enter the value. In the example below, a static value is set as the default date for the 'Start Date' column.
Whenever a new row is added, this column value is automatically populated by default.
Checking the 'Reset to default on update' option sets the default value for newly inserted rows and disables the column from editing. The existing values are retained, and automatically changed to default only when users edit other values in the specific record. Find below an example where the value changes to the default.
For the 'Decimal' input type, you can also specify the default number of decimal digits to be allowed.
For the 'Person' input type, you can either use their name or email address as default.
For the 'Single-select' type, you can choose the default value from the list of options you have configured.
For the 'Check Box' type, the default values are automatically configured with the Boolean values: true and false. You can change these to 1/0 or yes/no, etc., if necessary.
You can set derived values as defaults instead of using static values. These derived values are calculated using configurable formulas.
EDITable provides many Excel-like formulas and functions to help you perform these calculations. These values change dynamically as the underlying reference data changes.
Derived values can be set for the field types - Number, Decimal, Text, Date, DateTime, Person, and Email.
Checking the 'Recalculate data on update' option sets the calculated value as default for newly inserted rows and disables the column from editing. The existing values are retained and automatically changed to the derived value only when users edit other values in the specific record.
We have discussed setting constraints and defaults for table data. In the next section, we will explore how to select and look up values from a table or visual for a single-select field type.