Forms are an essential tool for collecting information from the public. However, submissions may sometimes include inaccurate, incomplete, or improperly formatted data, potentially disrupting business operations. To address this, the Form Field Validations feature allows you to define validation rules for each field, ensuring accurate and reliable data collection.
If the data entered in a form does not meet the specified validation criteria (for example, entering text in a numeric field or selecting too many options in a multi-picklist field), an error message is displayed. The form cannot be submitted until all validation errors are resolved, ensuring data integrity.
To add field validations to forms, navigate to Setup > Forms > Create Form/Existing Form. Hover over the field you want to validate, click the settings icon next to it, and configure your validations.
Fields Validations Options
The Form Field Validations feature supports various field types, each with specific validation options. These options vary based on the field type, as shown in the table below.
Field Type | Validation Rule | Explanation | Valid Input | Invalid Input |
Single Line | Set Minimum Character Limit | The input must meet the minimum requirement (e.g., 3), rejecting entries shorter than the specified length. | "John" (4 characters) | "J" (1 character) |
Set Maximum Character Limit | The input must meet the maximum requirement (e.g., 5), rejecting entries longer than the specified range. | "Ameila"(6 characters) | "Amei"(4 characters) |
Restrict Numbers | The field only accepts alphabetic characters, blocking numeric or special characters from being input. | "Alice" | "12345" |
Multi Line | Set Minimum Character Limit | Input must fall within the defined character range (e.g., no more than 1000 characters). Long entries are invalid. | "This is great!" (15 chars) | Text exceeding 1000 characters |
| Set Maximum Character Limit | Input must exceed the defined character limit (e.g., more than 10 characters). Entries not exceeding this limit are invalid. | "This is great!" (15 characters) | "Great"(5 characters) |
| Restrict Numbers | The field blocks numeric values, allowing only alphabetic characters in the input. | "User feedback" | "Feedback123" |
Multi Picklist | Minimum Options Limit | The user can select a limited number of options (e.g., minimum of 3). | Selecting 4 options | Selecting 2 options |
| Maximum Options Limit | The user can select a maximum number of options (e.g., maximum of 3). | Selecting 2 options | Selecting 4 options |
Number, Decimal, Percent, Long | Value Range Limit (Min, Max) | The input must be a number within the specified range (e.g., values outside 1 to 100 are rejected). | "50" (within 1 to 100) | "150" (exceeds 100) |
Date, Date and Time | Restrict Past Dates | Users cannot select dates earlier than the current day (e.g.,, selecting any past date is invalid). | Today’s date | A date from last month |
| Restrict Future Dates | Users cannot select dates beyond a defined limit (e.g., 6 months from today). | A date within next week | A date two years in the future |
| Set Date Range | The input must fall within a defined date range (e.g., dates in January 2025 only). Dates outside this range are invalid. | A date within January 2025 | A date outside January 2025 |
Currency | Value Limit (Min, Max) | The currency value must fall between the minimum and maximum limits (e.g., values below $100 or above $10,000 are invalid). | "$500" (within $100 to $10,000) | "$50" (below $100) |
Email | Restrict Specific Domains | The field blocks emails from restricted domains (e.g., "example.com"), allowing only permitted domain names. | "user@company.com" | "user@example.com" |
| Allow Specific Domains | The field only accepts email addresses from specified domains (e.g., "company.com"), blocking others. | "user@company.com" | "user@gmail.com" |
Phone | Show Country Code | The phone number must include a visible country code (e.g., "+1"). Inputs without it are invalid. | "+1 1234567890" | "1234567890" (missing code) |
| Default Country Code | The field auto-prefills a default country code (e.g., "+91") without requiring the user to enter it. | Automatically "+91" | Manually entering "+91" |
| Restrict Alphabets | The field does not allow alphabetic characters in phone numbers, ensuring only numeric input is accepted. | "9876543210" | "98765AB210" |
In addition to the validations listed in the table above, there is also the Default Field Value option. This allows you to predefine a value for a field, which will automatically populate when the form loads.
Next, we will have a look at each field in detail.
Single Line and Multi Line:
Character Limit (Min, Max): The input field enforces a minimum and maximum character requirement.
Restrict Numbers: The input field only allows alphabetic characters, blocking numbers, and special characters.
If the entered data does not comply with the validation rules, an error message is displayed during form submission, preventing the form from being submitted. The form is successfully submitted only when the data meets all validation criteria.
Multi Picklist: Allows users to select multiple options from a predefined list.
A multi-picklist field can be configured with validation rules to control the number of options a user can select. For example, the field may allow a minimum of 1 option and a maximum of 3 options. If the user selects fewer than the minimum or exceeds the maximum limit, the input is considered invalid.
Selecting within the limit: Choosing 2 options is valid, as it falls within the allowed range.
Exceeding the limit: Selecting 5 options is invalid, as it surpasses the maximum limit of 3.
Number, Decimal, Percent, Long: Numeric fields for specific types of numeric inputs. A numeric input field, whether for whole numbers, decimals, percentages, or long integers, can include a value range limit to ensure that the input falls within a specified range.
Date, Date and Time: Fields for capturing date or date-time inputs. A date or date-and-time field can be configured with various restrictions to ensure the input adheres to specific requirements. These validations help maintain consistency and accuracy in the data collected.
All Dates: Users can select any date, without any restrictions.
Restrict Past Dates: Users are prevented from selecting dates earlier than the current day.
Restrict Future Dates: Users cannot select dates beyond a defined limit, such as 6 months from today.
Set Date Range: The input must fall within a specific date range, such as dates in January 2025 only. A date within January 2025 is valid, but a date outside this range is invalid.

Currency: A numeric field specifically for monetary values. A currency field can be configured with a value limit to ensure the input falls within a specified range.
Email: A field for capturing email addresses. An email field can be configured with domain-based restrictions to ensure the input meets specific criteria. These rules help control the types of email addresses that are accepted.
Restrict Specific Domains: The field blocks email addresses from certain domains, such as "example.com." For example, "user@company.com" would be valid, but "user@example.com" would be rejected. Allow Specific Domains: The field only accepts email addresses from approved domains, such as "company.com," and blocks others. For example, "user@company.com" would be valid, while "user@gmail.com" would be invalid.
Phone: A field for capturing phone numbers. A phone number field can be configured with specific validations to ensure the input meets the required format and standards. These rules help maintain consistency and prevent invalid entries.
Show Country Code: The phone number must include a visible country code, such as "+1." For example, "+1 1234567890" is valid, while "1234567890" (missing the country code) is invalid.
Default Country Code: The field can auto-fill a default country code, like "+91," so the user doesn’t need to enter it manually. For instance, the field may automatically display "+91" for Indian numbers.
Restrict Alphabets: The field ensures that only numeric input is allowed, blocking alphabetic characters. For example, "9876543210" is valid, but "98765AB210" is rejected.
By leveraging these validation settings, users can ensure that the data collected through forms meets their specific requirements and business standards.
Availability
It is available for all editions.
Permissions
Form validation will be accessible to users who have 'Forms' permission enabled in their Profile.