Share Values with Global Value Sets
Learning Objectives
- Create global value sets.
- Manage global value sets.
- Promote an existing field’s values to a global value set.
Sharing Makes for Easier Caring
Global value sets let you share the same picklist values with more than one picklist field. Imagine your bakery has several places where it needs to list ingredients. Assign the same set of ingredient values to more than one picklist field. Pick a single ingredient in one picklist field, and several ingredients in a custom multi-select field from the same value set.
Consistency of values across more than one picklist makes it easier to enter the right values, and your data is more reliable. As you change the values in a global value set, the revised values show up in all the picklists using it.
Create a Global Value Set
Global value sets are always restricted. You can’t convert them to unrestricted. This protects your values, because changing global value set values modifies the values for all the fields that reference the global value set.
While you can edit them, later, be mindful to create values that make sense across multiple fields.
- From Setup, enter Picklist in the Quick Find box, then select Picklist Value Sets.
- Next to Global Value Sets, click New.
- Enter a label for the global value set. This name identifies the set in Setup, and appears as Values option when users create a picklist field.
- To tell users what these values are for, enter a specific description of the global value set. This text appears on the Picklist Value Sets list page in Setup.
- Enter the values, one per line.
- Optionally, choose to sort the values alphabetically or to use the first value in the list as the default value, or both. If you select both options, Salesforce alphabetizes the entries and then sets the first alphabetized value as the default.
- Click Save. To move values or re-alphabetize them, use Reorder.
Use the Global Value Set in a Picklist Field
Let’s go back and take a look at the page where you set a custom picklist’s properties.
- In Setup, click the Object Manager tab, and then select the object to contain the picklist field.
- Click Fields & Relationships.
- Click New. Select Picklist, and then click Next.
- Enter a Field Label.
- Keep the default Values option (Use a global value set) and then choose the global picklist you want to use from the picklist.
- Select other field settings as needed and click Next.
- Set field-level security for the picklist field, and then click Next.
- Choose the page layouts on which to include the picklist field, and then click Save.
Manage Values for Global Value Sets
As with other picklist values, you can reorder, replace, and change the default value of a global value set. You can also edit, delete, and deactivate individual values. Keep in mind, the changes apply to all picklist fields that use the global value set.
- From Setup, enter Picklist in the Quick Find box, then select Picklist Value Sets.
- Click the Label of the global value set to see its details.
- Click Edit at the top to change the Label, API Name, or Description of the set.
- In the Values related list, you can change individual values and their properties. For example, click Edit next to a value to set it as the Default for the set.
- To replace a value, create the new value first. Then click Replace to start the process.
- When replacing a value, the Replace all blank values option assigns the new value to all picklist fields that are currently blank.
- Deleting a value in a global value set goes to the background jobs queue. When the job completes, your picklist is updated and you’re notified by email.
Promote Existing Field Values to a Global Value Set
You don’t always know which picklist values make a good global value set before you’ve started using a picklist field. If you find that a particular set of values for one field makes a good set for another field, you can promote the existing value set to a global value set. Then, use it when you create a new custom picklist field.
- Go to the Fields & Relationships section of the object that contains the picklist you want to convert.
- Click the Field Label for the picklist.
- Click Edit.
- Click Promote to Global Value Set.
- Enter a label for the global value set.
- Accept the Field Name or edit it.
- Optionally, enter a description to identify it when using the values for other custom picklists.
- Click Promote to Global Value Set, again.
You see the value set in the Values section.
Global value sets offer efficiency and consistency across multiple picklists. But remember, global value sets are always restricted. Independent custom field values are more flexible, but higher maintenance.
We believe you’ve just about earned your cookie.
You certainly know enough to pick the right picklist, and how to change a picklist as your needs change. Picklists are great for directing data entry and managing values for data consistency.