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.
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.
- Log in to the admin control panel.
- From the Home tab, click Custom Fields.
- Click Fields and select the custom field you want to modify.
- NOTE: If you have not created a custom field yet, please see the Creating Custom Fields article.
- Click the Options tab.
- Enter the Regular Expression you want to use in the 'Pattern match' field.
- Click Update to save your changes.