Data Modeling and Management · Topic 2 of 3

Field Data Type Considerations

Salesforce field types for app builders: choosing text, number, picklist, formula and lookup fields, external IDs, and what changing a field type does.

  • 4 min
In a nutshell
  • Text holds up to 255 characters; long and rich text areas hold more.
  • Restricted picklists block values not in the list, even through the API.
  • External ID fields support upsert and integration matching.

What it is

Every custom field has a data type, such as Text, Number, Date, Picklist or Lookup. The type decides what the field can store, how it is validated, how it appears on pages and in reports, and what formulas and automation can do with it.

Choosing the right type at the start avoids data loss later, because changing a type can delete or truncate existing values.

RequirementChoose data typeSet attributesrequired, unique, external IDField level securityAdd to layouts

How it works

Common data types

TypeUse it for
TextShort free text, up to 255 characters
Text Area (Long) and Rich TextLong descriptions and notes
Number, Currency, PercentValues used in calculations, with set decimal places
Date, Date/Time, TimePoints in time
CheckboxTrue or false
PicklistOne value from a defined list
Picklist (Multi-Select)Several values from a list
Email, Phone, URLFormatted contact values that users can click
Auto NumberA system-generated sequence, such as INV-0001
FormulaA read-only value calculated from other fields
Roll-Up SummaryA COUNT, SUM, MIN or MAX of detail records
Lookup and Master-DetailRelationships to other records
GeolocationLatitude and longitude

Picklists

  • A restricted picklist accepts only its defined values, including through the API.
  • A global value set shares one list of values across several picklist fields.
  • Dependent picklists filter one picklist's values by a controlling field.
  • Record types can show a different subset of picklist values to different users.

Multi-select picklists are harder to use in reports, formulas and filters. Prefer a single-select picklist, or a related object, when you need clean reporting.

Field attributes

AttributeEffect
RequiredMust have a value on every save, from any source
UniqueNo two records can share the same value
External IDIndexed and used to match records during imports and integrations
Default valueFilled in when a record is created

External ID fields help when data comes from another system: imports can upsert records by matching on the external ID instead of the Salesforce record ID.

Changing a field's data type

Changing a type is possible for many fields, but with consequences:

  • Values that do not fit the new type can be lost, such as text that is not a number.
  • Some changes are blocked, for example when the field is used in a formula, roll-up summary or other dependency.
  • Some conversions are not offered at all, such as turning a formula field into a regular field; you create a new field instead.

Always back up data before changing a type on a field that holds data.

Deleting fields

A deleted custom field goes to the Deleted Fields list, where it can be restored for a limited time with its data. A field cannot be deleted while it is referenced elsewhere, such as in a formula, flow or Apex.

A worked example: a team stores contract length as free text, such as "12 months" and "1 year". Reporting on it is impossible. The builder creates a new Number field, fills it from the old values with a data load after cleaning them, updates the layouts and reports, and then deletes the old text field rather than converting it and losing the values that do not convert.

Exam tip

Choose a picklist rather than free text whenever values must be reported on or used in automation.

How the exam asks about this

  • "Integration must match records from another system." An External ID field.
  • "The same list of values on several objects." A global value set.
  • "Show only some values to one team." A record type with its own picklist values.

What to remember for the exam

  • Text holds up to 255 characters; long and rich text areas hold more.
  • Restricted picklists block values not in the list, even through the API.
  • External ID fields support upsert and integration matching.
  • Changing a data type can lose data; some changes are blocked by dependencies.
  • Prefer single-select picklists over multi-select for reporting.
Watch out

Changing a field from Text to Number deletes values that are not valid numbers. Check the data first.

Common mistakes

Using free text for values the business reports on. Use a picklist.

Assuming a required field only applies on the page layout. A field set as required at field level applies to every save.

Converting a field type without a backup. Values that cannot convert are lost.

Check yourself

  • Which field attribute lets an import match records using another system's identifier?

    The External ID attribute.

  • What does a restricted picklist prevent?

    Saving any value that is not in the picklist's defined list, including through the API.

  • What risk comes with changing a field's data type?

    Values that do not fit the new type can be lost.

Topic 2 of 3 in Data Modeling and Management

Test yourself on Data Modeling and Management

The full Salesforce Platform App Builder question bank has 648 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Salesforce. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.