Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 36 ยท Objects, Fields and Data Model

Field Types and Picklists: Choosing the Right Data Type

Learn the Salesforce field types, how to pick between text, number, currency, date, checkbox and picklist, and how to build global value sets and dependent picklists.

A field is a column on an object. Choosing the right data type matters, because a type decides how data is validated, how it sorts and filters, how it appears in reports and what formulas can do with it. Changing a type later can lose data, so think before you click.

The common field types

Type Stores Notes
Text Up to 255 characters Single line
Text Area Up to 255 characters, multiple lines
Text Area (Long) Up to 131,072 characters Not filterable in reports in the usual way
Text Area (Rich) Formatted text and images
Number Numeric with chosen digits and decimals Quantities, scores
Currency Money; follows org currency settings Multi-currency adds conversion
Percent A number shown with % Stored as the number itself
Date, Date/Time, Time Calendar values Date/Time is stored in UTC, shown in the user's time zone
Checkbox True or false Always has a value, default unchecked
Picklist One value from a list
Picklist (Multi-Select) Several values Stored as one semicolon-separated string
Email, Phone, URL Validated formats Clickable on record pages
Geolocation Latitude and longitude
Auto Number Generated sequence with a format Read-only
Formula Calculated from other fields Next lessons
Roll-Up Summary Aggregate of child records Master-detail only
Lookup and Master-Detail Link to another record Relationship fields, next lesson
Encrypted Text Masked text For sensitive strings; has restrictions on use

Creating a field

Setup > Object Manager > choose the object > Fields & Relationships > New. The wizard has four steps:

  1. Choose the data type.
  2. Enter details: Field Label, Field Name (API name), length or decimals, whether it is Required, Unique, External ID, a Default value, help text and a description.
  3. Establish field-level security: which profiles can see or edit it.
  4. Add to page layouts: which layouts show the field.

Steps 3 and 4 are where many mistakes happen: if you make a field visible to nobody or add it to no layout, users will not see it, which is a classic "where is my field?" case.

Useful field properties

  • Required (on the field definition) makes the field mandatory everywhere, including imports and API calls. A field that is only required on a layout can still be filled through other channels. Prefer layout-level requirement or a validation rule when the requirement depends on context.
  • Unique prevents two records having the same value (case-sensitive or not, as you choose).
  • External ID marks the field as a key from another system. External IDs are indexed and let you upsert on them during imports.
  • Help text shows a small info bubble: free documentation.
  • Track Field History is configured on the object, not the field wizard.
Python Stand-in: validate values against field types

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Picklists

A picklist offers a fixed list of values, which keeps data consistent. A free-text field for "Country" produces "USA", "U.S.A." and "United States", which wrecks reports; a picklist produces one spelling.

Create one with data type Picklist, then enter values (one per line) or choose a global value set. Options:

  • Sort values alphabetically or keep your order.
  • Use first value as default value.
  • Restrict picklist to the values defined in the value set. Without this, API and import users can add values that are not in the list. Turn it on for clean data.
  • Record types can show a different subset of values per type.

Global value sets

A global value set (Setup > Picklist Value Sets) is a list shared by many picklists, for instance "Countries" on Lead, Contact and Account. Edit it once and every field using it updates.

Dependent picklists

A dependent picklist limits its values according to a controlling field. Choose Country (controlling) and State (dependent); picking "United States" shows US states only. The controlling field can be a picklist or a checkbox. To set one up, open the dependent field's Field Dependencies and click Edit to include the values permitted for each controlling value.

Python Stand-in: a dependent picklist

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Multi-select picklists

Multi-select picklists store several values as one text string, for example Email;Phone. They are tempting but awkward: they are harder to report on, cannot be used in roll-ups and make formulas clumsy (you need INCLUDES()). If you need to count or analyze each choice, a related object with one row per choice is usually better.

Standard picklists

Fields such as Lead Status, Opportunity Stage, Case Status and Industry are standard picklists. You can edit their values, but some require a specific mapping (for instance a Stage must be marked Closed or Won).

Renaming and deleting values

Editing a picklist value name replaces the value in existing records (optionally). Deleting a value asks whether to replace it with another value on existing records. Deactivating is safer: the value disappears from new entries but remains on old records.

Field changes you cannot undo easily

  • Changing a type may delete data (Text to Number drops non-numeric values).
  • Reducing a text length truncates data.
  • Deleted custom fields go to the Deleted Fields list for 15 days and can be restored in that time.
  • Standard fields can be hidden but not deleted.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why use a picklist instead of a text field for something like Country?

    A fixed list avoids spelling variants and keeps reporting clean.
  2. 2. What does a dependent picklist depend on?

    The values shown in a dependent picklist are filtered by the controlling field's value.
  3. 3. What is an External ID field used for?

    External ID fields are indexed keys from outside systems and support upsert operations.
  4. 4. Which drawback applies to multi-select picklists?

    Selected values are stored as a semicolon-separated string, so analysis usually needs a related object instead.

Summary

  • Pick the field type for how the data will be validated, sorted and reported.
  • The field wizard also controls field-level security and layout placement, so finish all steps.
  • Use picklists, global value sets and dependent picklists to keep data clean; prefer related objects to multi-select picklists.
  • Type and length changes can destroy data, so test in a sandbox.

Next: Relationships: Lookup and Master-Detail