Skip to main content

Map a Custom Object

Capturing Data in Custom Objects

It’s time to tackle the other challenge at No More Homelessness (NMH): tracking information gathered from donor surveys, if the survey has been completed, and if it's been acknowledged. NMH’s solution is to create a custom object and import what they've tracked in spreadsheets.

In this step you follow along as Gorav, NMH’s fearless admin, creates a custom object and associated fields, modifies the NPSP Data Import staging object, and maps the fields for the importer. If some of the steps here sound familiar, that’s because you’re following the same steps you did previously with fields on a standard object, but for fields on a custom object instead. 

A process diagram with create target fields, create staging fields, and connect staging and target fields highlighted

Note

The custom object you create here is an example and not a full solution. NMH would have to add additional fields and functionality to meet its needs. Remember to check the Salesforce AppExchange (linked in Resources) to see if there’s a solution ready-made for your real-world challenges.

Create the Custom Object and Fields

First, create the custom object.

  1. Go to Setup.
  2. Click Object Manager.
  3. Click Create, then Custom Object.
  4. Enter this information:
    • Label: Donor Survey
    • Plural Label: Donor Surveys
    • Object Name: Donor_Survey (This should populate automatically.)
    • Description: For tracking donor surveys and acknowledgements.

      The Custom Object Information area of the new Custom Object page

    • In Enter Record Name Label and Format:
      • Enter Survey Number for the Record Name.
      • Select the Data Type of Auto Number.
      • In Display Format, enter DS-{0000}.
      • In Starting Number, enter 0001.
    • Select Allow Reports.
    • Select Allow Activities.
    • In the Object Creation Options section, check Launch New Custom Tab Wizard after saving this custom object.
  5. Click Save.
  6. Click on Tab Style and select an icon. You chose Form, but you can get creative.
  7. Click Next, then Next, then Save.
Note

If you want more details on creating custom objects, check out Custom Objects: Quick Look, linked in Resources.

The donor survey object is now created. Next, add two fields to this object. The first is a picklist for which you want to create a new picklist value set.

  1. Click Home in Setup.
  2. Enter Picklist in the Quick Find box, then select Picklist Value Sets.
  3. Next to Global Value Sets, click New.
  4. In Label, enter Survey Status.
  5. In Name, enter Survey_Status. (This should populate automatically.)
  6. Enter these values, one per line:

    Sent
    Completed
    Thanked
  7. Click Save.

Now, you’re ready to add the fields.

  1. Click Object Manager in Setup.
  2. Find and select the Donor Survey object.
  3. Click Fields & Relationships.
  4. Click New.
  5. Select Lookup Relationship, and click Next.
  6. Select Contact in the Related To field, and click Next.
  7. Leave the Field Label as Contact and Field Name as Contact, and click Next.
  8. Click Next, then Next, then Save & New to create the next field.
  9. Select Picklist, and click Next.
  10. Enter these details:
    • Field Label: Status 
    • Leave Use global picklist value set selected, and then select Survey Status from the picklist.
    • Field Name: Status (This should populate automatically.)
  1. Click Next, then Next, then Save.

NMH would need other fields to make this object useful, but let’s stop here to focus on mapping.

Check out the new object by clicking the App Launcher ( The App Launcher icon), then finding and selecting Donor Surveys. None exist yet, so click New to check that all of your new fields are there as you’d expect.

A new donor survey

Create Staging Fields

Now you need to modify the NPSP Data Import object to add one of the new fields you just created. Why only one? Because your new donor survey object uses lookup fields to connect to contact records and those are already in the NPSP Data Import object. You will map them later.

Create the staging field you need now for the status.

  1. Go to Setup, then click Object Manager.
  2. Find and select the NPSP Data Import object.
  3. Click Fields & Relationships.
  4. Click New.
  5. Select Picklist, and click Next.
  6. Enter these details:
    • Field Label: Donor Survey Status 
    • Leave Use global picklist value set selected, and then select Survey Status from the picklist.
    • Field Name: Donor_Survey_Status (This should populate automatically.)
  1. Click Next, then Next, then Save.

You also want to create two new system fields to capture information about the target records processed by NPSP Data Importer: a status field that indicates if the dry run or import was successful and a lookup field that links you to the final imported record.

  1. Starting from the Fields & Relationships tab on NPSP Data Import record in the Object Manager, click New.
  2. Select Text, and click Next.
  3. Enter these values:
    • Field Label: Donor Survey Import Status
    • Length: 255 (You must enter this max allowable value of 255 for a text field for all Import Status fields.)
    • Field Name: Donor_Survey_Import_Status (This should populate automatically.)
  1. Click Next, then Next, then Save & New to create the next field.
  2. Select Lookup Relationship, and click Next.
  3. In the Related To field, select Donor Survey and click Next.
  4. Change the Field Label to Donor Survey Imported and press the tab key to populate the Field Name with Donor_Survey_Imported, then click Next.
  5. Click Next, then Next, then Save.

Clean Up the Page Layout

While you’re on the NPSP Data Import object in the Object Manager, clean up the page layout so it’s easy to find your new fields. Taking the time to order your NPSP Data Import page layout can help you quickly review imported data and save you time later on.

  1. Click Page Layouts.
  2. Click Data Import Layout.
  3. Add a new section. With Fields highlighted at the top of the screen, click and drag the Section element onto the page after the Donation Information section.

    The Section element under the Fields menu

  4. Name your section Donor Survey Information and click OK.
  5. Our new fields appear by default in the Information section at the top of the page. You can click and drag these to your new section from here, or click the remove button (The remove button) and then drag them from the top Fields area to the new section.

    The Donor Survey Information section in the layout editor

  6. Click Save.

If you go to one of the NPSP Data Import records you were working with before, the new section should look something like this.

The Donor Survey Information section on the NPSP Data Import record

Create Advanced Mappings

With all of your fields in place and the page layout cleaned up, it’s time to connect the donor survey object and the NPSP Data Import object with Advanced Mapping. 

Remember when you mapped your new and standard fields for Contact1 and Contact2? You modified an existing object group. Because you are mapping a new object, you need to create a new object group first.

  1. Click on the App Launcher (The App Launcher icon), then find and select NPSP Settings.
  2. Click System Tools.
  3. Click Advanced Mapping for Data Import & Gift Entry.
  4. Click Configure Advanced Mapping.
  5. Click Create New Object Group.

    The Create New Object Group button

  6. Enter these details:
    • Group Name: Donor Survey
    • Object Name: Donor Survey (Donor_Survey__c)
    • Is Child/Parent: Child
    • Of This Object Group: Contact 1
    • Through This Field: Contact (Contact__c)
    • Link to Record: Donor Survey Imported (Donor_Survey_Imported__c)
    • Import Status: Donor Survey Import Status (Donor_Survey_Import_Status__c)

      The Create Object Group interface

  1. Click Save.

It may take a few seconds to process the new object group. Once that process is complete, it’s time to add the field mappings.

  1. In the Donor Survey row, click the menu arrow (The menu arrow) and select View Field Mappings.
  2. Click Create New Field Mapping.
  3. Find and select Donor Survey Status (Donor_Survey_Status__c) as the source.
  4. Find and select Status (Status__c) as the target.

    The New Donor Survey Field Mapping interface for the Donor Survey Status field

  5. Click Save.

You created the new custom target object and fields, created staging fields on the NPSP Data Import object, and created your mapping. Now, get your data ready and bring it into Salesforce.

You tackle that in the next step, but before you move on, make sure that you select the Trailhead Playground where you followed along with this step and click Verify.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback