Import Data to a Custom Object
Now that we have our new object created and the fields mapped, it’s time to go back into the spreadsheets and finish this import.
Update the Template
Open the template you modified earlier; the one you saved before you entered data and deleted columns.
Let’s add our new field to the template.
- Add a new columns after the Donation Type column.
- Enter
Donor Survey Status
in the header row.
- Save the template.
Create Test Records
Now, let’s create our test records.
- In the first data row of the template, enter this information:
- Contact1 First Name:
Silas
- Contact1 Last Name:
Stetson
- Contact1 Preferred Language:
English
- Contact1 Email Opt Out:
False
- Contact1 Personal Email:
silas@mailinator.com
- Contact1 Preferred Email:
Personal
- Donation Donor:
Contact1
- Donation Amount:
5000
- Donation Date: Set to the last day of this month
- Donation Stage:
Pledged
- Donor Survey Status:
Completed
- Contact1 First Name:
- In the second data row in the template, enter this information:
- Contact1 First Name:
Marie
- Contact1 Last Name:
Maldonado
- Contact1 Preferred Language:
Spanish
- Contact1 Email Opt Out:
False
- Contact1 Personal Email:
marie@mailinator.com
- Contact1 Preferred Email:
Personal
- Donation Donor:
Contact1
- Donation Amount:
2500
- Donation Date: Set to the last day of this month
- Donation Stage:
Closed Won
- Donor Survey Status:
Thanked
- Contact1 First Name:
- Optionally, delete any unused columns. (If you do, you should have columns through letter K.)
- Save the file as a .csv on your desktop.
Upload Your CSV to NPSP Data Import Objects
It’s time to test our work by importing it to NPSP Data Import objects.
- Go to the App Launcher (
), enter
NPSP
in the search bar, and select NPSP Data Imports. - Click Import.
- On the Custom objects tab, click NPSP Data Imports.
- Click Add new records under “What do you want to do?” and leave all of the associated settings as their defaults.
- In the “Where is your data located?” panel, either drag your CSV to where it says “Drag CSV file here to upload” or click CSV and then Choose file to select the CSV you just saved.
- Click Next.
- You’re now on the Edit Field Mapping page. Make sure that your column headers in your CSV and the destinations in the NPSP Data Import object match (if you followed these instructions, they should), then click Next.
- On the Review & Start Import page, you should see that the import will include 11 mapped fields and 0 unmapped fields. Click Start Import.
- Click OK on the “Congratulations!” popup.
You’ll find yourself on a Bulk Data Load Jobs page again, where you can check the results in the Batches area.
Use the App Launcher () to go back to the NPSP Data Imports page, then select the To Be Imported list view. Check the first record, for Silas Stetson, and scroll down to the bottom of the page to check that the donor survey data came through.
It looks like it did! You’ll notice that the Donor Survey Import Status and Donor Survey Imported fields are empty now, though, because those fields are automatically populated during the import.
Perform an Import Dry Run
Now that the records are in NPSP Data Import objects, let’s check them by performing an optional dry run to check for problems.
- Starting on the To Be Imported list view on the NPSP Data Imports page, click Start Data Import.
- Leave the settings as they are for now, and click Begin Dry Run.
- Wait for the dry run to complete, and then check the status. You should have 2 records processed and 2 records validated. Click Close.
- Back on the NPSP Data Imports page, change the list view to Dry Run - Validated.
Check out the records. They should both be validated and ready for import.
Import Your Data
It’s import time!
- On the Dry Run - Validated list view on the NPSP Data Import page, click Start Data Import.
- On the next page, leave the Configuration Options as they are and click Begin Data Import Process.
- Wait for the import to complete—this might take a minute—and then check the status. You should have 2 records processed and 2 records validated. Click Close.
Check the Results
Back on the NPSP Data Imports page, select the Successfully Imported list view and click into the record for Silas Stetson.
Scroll down to the very bottom of the record to see the status update for the donor survey record. The Donor Survey Import Status should be Created, and you should see a link underneath Donor Survey Imported.
Click on the link in the Donor Survey Imported field to view the donor survey record.
You’ll see that the donor survey number was automatically created, the contact record was related by NPSP Data Importer, and our status was imported.
Now, click into the contact record and click on the Related tab. You can see that the donor survey was automatically related here, as well.
When you complete an import like this and you’re happy with the results, you’ll usually want to delete the NPSP Data Import staging records (check out the link in Resources below). Don’t do that in your playground now, though, because we check those records to complete this challenge.
The Tools for the Job
In this project you created new custom objects and fields, created corresponding staging fields on the NPSP Data Import object, used Advanced Mapping to create the fields, and imported data. Pat yourself on the back—this is a HUGE accomplishment!
The example from our friends at No More Homelessness (NMH) was pretty simple. But these are the same building blocks you’ll use whether you are importing data to a standard field not included in NPSP Data Importer, to your own custom elements, or to elements you added with an AppExchange app or other managed package.
And remember, you don’t have to go it alone. Check out the detailed documentation we’ve linked to in Resources throughout this project, and you can always turn to the communities in the Power of Us Hub or the Nonprofits Using Salesforce group in the Trailblazer Community.
For now, celebrate this first step toward many importing adventures to come. If you’ve followed along with the instructions in this step, select your Trailhead Playground and click Verify to complete this project and receive your badge.
Resources
- Documentation: NPSP Data Importer Templates
- Documentation: Upload Data from the Template
- Documentation: Verify Data Upload
- Documentation: Verify Your Upload with Dry Run
- Documentation: Process Your Import
- Documentation: Delete Imported Records
- Documentation: Prepare to Match Based on Salesforce ID
- Power of Us Hub: Data Import Discussion Topic (Login Required)
- Trailblazer Community: Nonprofits Using Salesforce (Login Required)