Masked Textbox Control
  • 20 Aug 2024
  • 1 Minute to read
  • Dark
    Light

Masked Textbox Control

  • Dark
    Light

Article summary

The Masked Textbox Form control outputs data according to the format defined by a Value Type. The Value Type dropdown provides validation for default and custom Regex.

Example

  1. Create a Flow and add a Show Form step from the Toolbox panel. Click PICK OR CREATE FORM and create a new Form.
  2. In the Form Designer, add three Labels (PC Name, Email, MAC Address), three Masked Textbox controls (PCName, userEmail, macAddress), and a Button control (Submit).
  3. On the Properties panel, for each of the Masked Textbox control fields, the default Value Type is General. Select the userEmail field and change the Value Type to EmailAddress.
    Value Type OptionDescription
    GeneralAccepts any text formatting or characters
    NumberEnforces the textbox only to accept numbers
    DecimalConfigures the textbox only to accept numbers and decimal values
    CurrencyConfigures the textbox only to accept number values and only two decimal place values
    EmailAddressSets the textbox only to accept string values that contain an @ sign
    SSNConfigures the textbox only to accept a 9 digit SSN format
    PhoneNumberEnforce the textbox only to accept a 10 digit Phone number
    CustomAllows users to define their own custom string formatting

  4. Select the Masked Textbox control for the macAddress field and set the Value Type to Custom. Enter "^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$" in the Custom Mask (Regex) field.
    Regex SectionFunction
    ^The beginning of the line
    ([0-9A-F]Any numbers from 0-9 or uppercase letters
    {2}Two letters or digits
    [:-])The separator can be a : or -
    {5}Any five characters comprised of upper letters (A-F) or numbers (0-9)
    ([0-9A-F]Any numbers from 0-9 or uppercase letters
    {2})Two letters or digits
    $End of the value line
  5. Select the Override Display Mask option which will allow a user to customize the displayed format.  In the Custom Display Mask field, enter "99-99-99-99-99-99". A 9 is used to enable the end-user to enter any digit. Using another number will set that number in the format. Click Save and close the Form Designer.
  6. Set the Input fields to Ignore for the mac Address, PC Name, and user Email fields. Connect the Submit path to the End step. Click Save to save changes to the Flow.

Debug

  1. On the top action bar, click Debug.
  2. Click START DEBUGGING. 
  3. The Form will display. Attempt to select the Submit button without providing valid text in the masked textboxes and an error message will display. 
  4. Provide valid text and click Submit.

For further information on Forms, visit the Decisions Forum.

Was this article helpful?