Requests: Short Answer Field Validation

Introduction

FacilityBot now supports input validation for Short Answer fields in request forms. This feature allows Facility Managers to ensure that users enter information in the correct format—for example, email addresses, ID numbers, or license plate formats. By using validation, form submissions are cleaner, more consistent, and reduce the need for manual follow-ups.

To use this feature, log in to the FacilityBot Web Portal. 

  • Navigate to ‘Features’, ‘Requests’, ‘View Request Settings’
  • Select the Request Type form and click edit (You may create a new request form or edit an existing one)
  • Add a Short Answer component to the form, or select an existing one.
  • In this example, we will create a Phone Number field that requires an input of 10 to 12 digits. A validation rule will be set so that the requestor receives an error message if the input does not meet this format.
  • You may choose a validation type from the dropdown whether it is a text, number, length or a regular expression validation. In this example we will use a regular expression validation.
  • Select a condition—whether it contains, does not contain, matches, or does not match the specified input. In this case choose matches
  • For the pattern, you can look up regular expressions online or ask ChatGPT for assistance. In this example, we’ll use the pattern ^\\d{10,12}$ with the error message: “Enter a number with 10–12 digits.”

Examples of Useful Validation Patterns

  • Email Address
    ^[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}$
    Error Message: “Please enter a valid email address.”
  • Phone Number
    ^\\d{10,12}$
    Error Message: “Enter a number with 10–12 digits.”
  • Employee ID (e.g., AB123456)
    ^[A-Z]{2}\\d{6}$
    Error Message: “Format must be two letters followed by six digits.”
  • Click Save to apply changes to the component.

To test the configured validation

  • Go to  ‘Features’, ‘Requests’ and click ‘+ New Request’
  • Select the form you configured with field validation
  • ill out the field you configured for validation. In the example below, we entered text instead of numbers, which triggered the error message: ‘Enter a number with 10–12 digits.’

Short Answer Field Validation gives Facility Managers greater control over the quality of submitted data. By ensuring that users input the correct formats, the system becomes more reliable and efficient for all stakeholders.