Setup Your Salesforce Data Model

In Salesforce, data is stored in an object. You can think of an object as a list of items or a spreadsheet. It’s a place to store and maintain information that’s grouped by fields, like the first name and last name of each customer.

A detail of an excel spreadsheet with data in two columns.

There are two types of objects: standard objects and custom objects. Standard objects are objects that are included with Salesforce. Common business objects like Account, Contact, Lead, and Opportunity belong to that group. 

Custom objects are objects you create to store information that's specific to your company or industry. In this step, you create two custom objects, and add a new field to a standard object. Together, these three objects make up the data model for the conference management app.

Create the Session Object

Salesforce provides a tool called Lightning Object Creator that turns spreadsheets and CSV files into apps with just a few clicks. With the Lightning Object Creator, you can translate the columns of a spreadsheet into fields, define field types, and import spreadsheet data.

Use the Lightning Object Creator to create an object that holds your session data.

  1. Download this CSV file (right click and select Save Link As) which contains a list of sessions.
  2. In your Trailhead Playground, click Setup Gear Icon. and select Setup. This launches Setup in a new tab.
  3. Click Object Manager.
  4. Click Create and select Custom Object from Spreadsheet.
    Navigation steps for creating a new custom object from spreadsheet.
  5. Lightning Object Creator opens in a new tab. Click Log in with Salesforce.
    Custom Object from Spreadsheet wizard with options to Log in to Salesforce, and Log in with Sandbox.
  6. Enter your Trailhead Playground’s username and password, and click Login.
  7. Click Allow to allow Lightning Object Creator to access your Salesforce instance.
  8. In the next step, you have to select a source of your spreadsheet. Click Upload, then select the file you downloaded.
    Lightning Object Creator Wizard showing different data sources.
  9. Select Name from the dropdown in Record Name Field. The record name appears in page layouts, related lists, lookups, and search results.
  10. Select Picklist as the Salesforce Field Type for Room.
    Mapping Screen showing Salesforce Field Names and Data Types for each column of spreadsheet.
  11. Click Next.
  12. Enter these details in the Object properties screen:
    • Label: Session
    • Plural Label: Sessions
    • API Name: Session
      Object properties screen.
  13. Click Finish.
  14. Salesforce creates the object and its fields, and imports all of the spreadsheet data into the newly created object.
    Screen showing successful object creation and data import.
  15. Close the tab.

You just turned data from a CSV file into a data model. Next, change the data model on an existing standard object.

Add a New Field to the Contact Object

Contact, a standard object in Salesforce that’s used to store information about people, comes with a set of standard fields. For this project, you use the Contact object to store conference speaker details. You need to create one additional Contact field that stores the URL of the speaker’s profile picture. 

  1. In Setup, click Object Manager.
  2. From the list of objects shown, click Contact.
  3. Click Fields & Relationships and click New, which launches a wizard that lets you add a new field to the object.
  4. Select URL from the list of data types shown, and click Next.
  5. Define the field as follows:
    • Field Label: Picture URL
    • Field Name: Picture_URL
  6. Leave everything else as is, click Next, Next, then Save.

You changed the Contact data model, so that you can store information about the conference speakers in it. Next, finalize your data model with a junction object.

Create the Session Speaker Junction Object

A session can have one or many speakers, and a speaker can have one or many sessions. To reflect this many-to-many relationship in your data model, create another custom object which is used as a junction between the standard Contact object and the custom Session object. This junction object allows you to model a many-many relationship between sessions and speakers. 

  1. From Setup, click Object Manager.
  2. Click Create and select Custom Object.
  3. On the Custom Object Definition page, create the Session Speaker object with these details. (Accept the default values for the properties not defined here.)
    • Label: Session Speaker
    • Plural Label: Session Speakers
    • Object Name: Session_Speaker
    • Record Name: Session Speaker Number
    • Data Type: Auto Number
    • Display Format: SESP-{00000}
    • Starting Number: 1
  4. Click Save.
  5. Click Fields & Relationships and click New.
  6. Select Master-Detail Relationship and click Next.
  7. In Related To, select Session and click Next.
  8. Define the field:
    • Field Label: Session
    • Field Name: Session
  9. Leave everything else as is and click Next, Next, Next.
  10. Set Related List Label to Speakers, click Save & New.
  11. Select Master-Detail Relationship and click Next.
  12. In Related To, select Contact and click Next.
  13. Define the field:
    • Field Label: Speaker
    • Field Name: Speaker
  14. Leave everything else as is and click Next, Next, Next.
  15. Set Related List Label to Sessions and click Save.

Great job! In the next step, you load sample data into each object in the data model.

Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities