Let the platform do the work

Adding a Blank (NULL) Value as the First Value of a Dropdown List

Overview

Sugar allows you to add a blank (NULL) value as the first field of a dropdown list via Studio and the Dropdown Editor. The blank value should be the first item of the list so that when the dropdown list is used for a required field, the user will be forced to make a selection rather than allowing the field to default to a non-null value. This article will cover how to add a blank (NULL) value to a dropdown list via Studio and the Dropdown Editor.

Please refer to the Developer Tools documentation for more information on editing dropdown lists. 

Prerequisites

You must be an administrator or have developer-level role access in Sugar to make the necessary changes via Studio and the Dropdown Editor. 

Steps to Complete

You can add a blank value to a dropdown list being used by a particular field by editing the field via Studio. As an alternative, you may edit the dropdown list directly via the Dropdown Editor. The following steps below outline the process from both areas in Sugar.

Adding a Blank Value to a Dropdown List Via Studio

  1. Navigate to Admin > Studio > {Module Name} > Fields.
    Note: For this example, we will select the Bugs module.
  2. Select the dropdown field associated with the dropdown list you wish to edit or create a new dropdown field.
    Note: For this example, we will select the Priority field. 
  3. Select the dropdown list where you would like to add the blank value. Click the Edit button or create a new dropdown list by clicking the Add button.
    Note: For this example, we will edit the dropdown list. 
    Edit or add a dropdown list
  4. Without filling any values in the Item Name and Display Label fields, click "Add".
    Add NULL value
  5. Drag and drop the blank field as the first item of the list then click "Save".
    Move NULL value to the top of the list

Adding a Blank Value to a Dropdown List Via the Dropdown Editor

  1. Navigate to Admin > Dropdown Editor.
  2. Select the dropdown list to which you want to add a blank value or create a new one by clicking the Add Dropdown button.
    Note: For this example, we will select the bug_priority_dom dropdown list.
    Select the dropdown list in the Dropdown Editor
  3. Without filling any values in the Item Name and Display Label fields, click "Add". 
    Add NULL value
  4. Drag and drop the blank field as the first item of the list then click "Save". 
    Move NULL value to the top

Application

Once the necessary changes have been made, navigate to the specific module to confirm that the blank (NULL) value displays as the first field of the dropdown list. For this example, the Priority field in the Bugs module should now display the blank value as the first field of the dropdown list.
NULL value in list