Map Standard and Custom Fields on a Standard Object
Prepare to Import Standard and Custom Fields
Let’s start with the fields that No More Homelessness (NMH) would like to import to contact records: email opt-out and preferred language.
Email opt-out is a standard Salesforce field but not included by default in the NPSP Data Import object. Preferred language is not a standard Salesforce or NPSP field, so we will need to add this custom field to the Contact object and map it to the NPSP Data Import object in your Trailhead playground.
Remember the process: Create the custom fields, create the corresponding staging field on the NPSP Data Import object, then connect the two. That’s what we’ll do in this step.
Create the Custom Field on the Contact Object
First, let’s create the new custom preferred-language field. But before we dive into creating the new field itself, let’s create a new global picklist value set. We’ll use the same picklist values for three custom fields, so creating a global picklist value set will save us time and assure that the fields are uniformly updated if we need to add values in the future.
- Click the setup gear (
), then click Setup.
- Enter
Picklist
in the Quick Find box, then select Picklist Value Sets. - Next to the Global Value Sets header, click New.
- In the Label field, enter
Preferred Language
. - In the Name field, enter
Preferred_Language
. (This should populate automatically.) - Enter these values, one per line:
English
Spanish
Tagalog
Vietnamese
- Click Save.
With that picklist value set created, let’s create the new field.
- Click Object Manager in the Settings navigation bar.
- Find and select Contact.
- Click Fields & Relationships in the left rail.
- Click New.
- Select Picklist, and click Next.
- Enter these values:
- In the Field Label, enter
Preferred Language
. - In Values, leave Use global picklist value set selected, then select Preferred Language from the picklist.
- The Field Name should populate automatically to
Preferred_Language
.
- In the Field Label, enter
- Leave the other values as default, and click Next.
- Click Next on the next screen, then Save.
To verify that the contact record was updated correctly, click on the App Launcher (), find and select Contacts, and select a contact to view the field. It should appear on the Details tab in the Contact Details section.
While you’re here on the contact record, you can see the standard email opt-out field in the Contact Information section, as well.
Create Corresponding Fields on the NPSP Data Import Object
Now that both the preferred language and email opt-out fields exist on the contact object, we need to create corresponding fields (your staging fields) on the NPSP Data Import object. You’ll have to create these fields for both the NPSP Data Import object’s Contact 1 and Contact 2 if you want to import these fields for both members of a household.
Follow along in your Trailhead Playground as we create the fields.
First, let’s create the NPSP Data Import field for preferred language.
- Go to Setup.
- Click Object Manager.
- Find and select NPSP Data Import.
- Click Fields & Relationships.
- Click New.
- Select Picklist, and click Next. The NPSP Data Import field should be the same type as the target field—though we’ll bend that rule in a moment.
- Enter these values:
- In the Field Label, enter
Contact1 Preferred Language
. - In Values, leave Use global picklist value set selected, then select Preferred Language from the picklist.
- The Field Name should automatically populate with
Contact1_Preferred_Language
.
- In the Field Label, enter
- Leave the other values as default, and click Next.
- Click Next on the next screen, then Save & New.
- Repeat the same step but create the same field for
Contact2 Preferred Language
, then click Save at the end of the process before moving on.
Now, let’s create the NPSP Data Import object field for email opt-outs.
- On the NPSP Data Import record in the Object Manager, click Fields & Relationships.
- Click New.
- Here’s the exception to the rule we just covered: If your target field is a checkbox, you should select a picklist with True and False values to give yourself more flexibility. In your data for import,
True
would mean checked,False
would mean unchecked, and a blank value would leave the box unchanged if you were updating records. Select Picklist, and then click Next. - Enter these values:
- In the Field Label, enter
Contact1 Email Opt Out
. - In Values, select Enter values, with each value separated by a new line and in the box, enter these values:
True
False - The Field Name should automatically populate with
Contact1_Email_Opt_Out
.
- In the Field Label, enter
- Click Next.
- Click Next on the next screen, then Save & New.
- Repeat the same steps to create a field for
Contact2 Email Opt Out
, then click Save at the end of the process.
We’ve created all of the staging fields we need on the NPSP Data Import object. Now, let’s place them on the page layout.
- On the NPSP Data Import record in the Object Manager, click Page Layouts.
- Click Data Import Layout.
- Scroll down to the Information area and you can see that the new fields were added here by default. We want to move those to the Contact1 Information and Contact2 Information areas.
- Click and drag Contact1 Preferred Language under Contact1 Title in the Contact1 Information area.
- Click and drag Contact1 Email Opt Out above Contact1 Personal Email in the Contact1 Information area.
- Move the Contact2 Preferred Language and the Contact2 Email Opt Out fields to the corresponding locations in the Contact2 Information area.
- Click Save.
Now, we’re ready to map the staging fields in the NPSP Data Import object to the target fields in the contact object.
Turn on Advanced Mapping
Let’s start by making sure that Advanced Mapping is enabled.
- Click on the App Launcher (
), then find and select NPSP Settings. (It may take some time to load.)
- Click System Tools then Advanced Mapping for Data Import & Gift Entry.
- Click the toggle button to set Advanced Mapping to Enabled.
The page will load with a message saying, “Deployment in progress. You can leave this page. The page will reload when deployment is finished.” It may take a minute or two, so take the opportunity to practice some deep breathing.
Once the page reloads, click Configure Advanced Mapping.
Map the New Fields
After clicking Configure Advanced Mapping, you’ll see a list of Object Groups, which are collections of field mappings that tell NPSP Data Importer what objects (contacts, accounts, etc.) to create or update. There are already object groups for Contact 1 and Contact 2. We’ll edit those now.
First, let’s add the preferred language field mapping.
- Find the Contact 1 row, click on the menu button (
) and then click View Field Mappings.
- You're now on the Contact 1 Group Field Mappings page. Click Create New Field Mapping.
- In the Source (NPSP Data Import Object) Field Label search field, find and select
Contact1 Preferred Language (Contact1_Preferred_Language__c)
. - In the Target (Contact 1 Object) Field Label search field, find and select
Preferred Language (Preferred_Language__c)
.
- Click Save then refresh the page.
After the page reloads we're back on the Object Groups list. Next, we’ll create a new field mapping for email opt-outs for Contact 1.
- Look for the Contact 1 row and click View Field Mappings under the menu button (
) again.
- On the Contact 1 Group Field Mappings page, click Create New Field Mapping.
- In the Source (NPSP Data Import Object) Field Label search field, find and select
Contact1 Email Opt Out (Contact1_Email_Opt_Out__c)
. - In the Target (Contact 1 Object) Field Label search field, find and select
Email Opt Out (HasOptedOutOfEmail)
.
- Click Save.
You should receive a message that the update was successful. That maps our fields for Contact 1.
Now click Back to Object Group in the upper left corner to go to the list of Object Groups. Find the Contact 2 row, click on the menu button () and then click View Field Mappings, and repeat the steps above to map
Contact2 Email Opt Out (Contact2_Email_Opt_Out__c)
and Contact2 Preferred Language (Contact2_Preferred_Language__c)
to the corresponding target field on the contact record.
Get Ready to Prepare the Data
With the target and staging fields set up and mappings in place, we have everything we need in Salesforce to start importing our data.
In the next step, we’ll modify the import template and run a test import to check our work.
But before we move on, if you’ve followed along with the steps above, select the Trailhead Playground you are using for this project and click Verify.