Start a conversation

Is It Possible to Have a Mandatory Drop-Down Custom Field With No Default Value?

Overview

You might want to create a drop-down custom field without specifying a default value while making it a mandatory field.

A drop-down is a form field intended for listing many options in one condensed area of page space. This custom field will always have a pre-selected value from the options you specified. Hence, it's not possible to create one without a default value.

 

Solution

To work-around this need, you can make use of "regular expressions" on "pattern match". A regular expression is a pattern describing a certain amount of text, such as a particular character, words, or patterns of characters. The term ‘Regular Expressions’ is used as regex or regexp in common use. You can read more about this from this Wiki page. For basic regex syntax, we may refer to the link here

Your helpdesk has a feature that allows you to use pattern matches on mail parser rules, email breaklines, custom fields, etc.

In the example drop-down custom field below, you can see there are 5 options: A, B, C, D, and "Select" with "Select" as a pre-selected value.

custom_field_drop-down_options.png

Say you want end-users to select either A, B, C, or D only. To do this, you can use the Regular Expression /^((?!Select).)*$/i such that the drop-down field accepts any value or input apart from "Select".

 

To add a Regular Expression on custom fields:

NOTE: You need admin access with "update customer fields" permission to perform the following steps.

  1. Log in to the admin control panel.
  2. From the Home tab, click Custom Fields.
  3. Click Fields and select the custom field you want to modify.
  4. Click the Options tab. Custom_Fields___Edit_options.jpg
  5. Enter the Regular Expression you want to use in the 'Pattern match' field.
  6. Click Update to save your changes.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted
  3. Updated

Comments