Importing Contacts for Existing Accounts

In this tutorial we will show how to import a file with Contacts data for existing Salesforce Accounts. When preparing such a file, you need to somehow specify accounts, for which you insert these contacts. It's not an easy task to specify accounts in this file by their Salesforce Account IDs - 15- or 18-character strings. In such cases usually account names or some other, numeric IDs are used. But when importing this file to Salesforce, you need to assign values to the foreign key AccountID field. Skyvia offers two ways to solve this problem - external IDs or lookup.

Creating Connection

Regardless of the way you want to use to specify parent accounts for contacts, first you need to create a connection to the target Salesforce database, if you haven't created it before. To create a connection to Salesforce, perform the following steps:

1.Click Connections in the menu on the left side of the page to switch to the Connections page.
2.On the Connections page click the New button.
3.In the opened pane click Salesforce.
4.Specify the connection Name, for example, Salesforce1.
5.From the Environment drop-down list select the Salesforce environment type to import data to. Since this is just a sample walkthrough, the Sandbox environment is recommended.
6.From the Authentication drop-down list select the authentication method for connecting to Salesforce. If you don't mind storing your Salesforce credentials on our Skyvia server, select User Name & Password. If you prefer not to store your credentials, select OAuth 2.0.
 
salesforce-connection-oauth
7.If you have selected User Name & Password, on the previous step, specify your Salesforce account e-mail, password, and security token. Otherwise, if you have selected OAuth 2.0 authentication, click the Log In with Salesforce button and login via the Salesforce website on the opened page. The result OAuth token will be stored in the connection data. Your Salesforce credentials will not be stored on our website.
 
Login-to-Salesforce
8.Click the Save button to save the connection.
 
salesforce-connection-oauth-filled

Importing Contacts Using External IDs

External IDs can be used for importing if the Account Salesforce object has a custom external ID field. External ID fields are the fields that uniquely identify records. If your Account object has such an external ID custom field, and your CSV file with Contacts contain a column, identifying the parent accounts, use the following steps to import the contacts file:

1.Click Integration in the menu on the left side of the page.
2.Click the New button in the top right corner of the page.
3.Click Import.
4.In the Target header click Select and select Salesforce in the drop-down list.
5.Select Salesforce1 in the Target Connection drop-down list.
 
target-connection-selection
6.Click the + Add task button to open the Import Wizard.
7.Click the browse link and select the CSV file with Contacts data to import.
 
upload-csv-file
8.If necessary, set the CSV Options.
 
csv-options
9.Click the Next button in the bottom of the dialog box. You can also switch between the Import Wizard pages by clicking the corresponding icons in the wizard header and return to previous wizard page by clicking the Previous button.
10. In the Target list select Contact.
 
selecting-contact-single-object
11. Click the Next button in the bottom of the dialog box.
12. Click the AccountId field.
13. Click Column and then click External ID on the drop-down list.
14. In the Source Column drop-down list select the CSV file column, containing external id values, determining parent accounts.
15. In the External ID Column drop-down list select the Account external ID field name.
 
external-id-account
16. If the names of columns in the CSV file are not the same as Contact field name, map other unmapped fields to the source file columns.
17. Click the Finish button.
18. Click the Save button to save the package.

Now your package is ready, and you can run it to import your contacts.

Importing Contacts Using Lookup

By default, Account object does not have external ID fields. If you don't want to modify the Account object and add a custom external ID field to it, you can use lookup and identify parent accounts by their names. To import a CSV file of Contacts with the column, containing parent account names, perform the following steps:

1.Click Integration in the menu on the left side of the page.
2.Click the New button in the top right corner of the page.
3.Click Import.
4.In the Target header click Select and select Salesforce in the drop-down list.
5.Select Salesforce1 in the Salesforce Connection drop-down list.
 
target-connection-selection
6.Click the + Add task to open the Import Wizard.
7.Click the Upload button and select the CSV file with Contacts data to import.
 
upload-csv-file
8.If necessary, set the CSV Options.
 
csv-options
9.Click the Next button in the bottom of the dialog box.
10. Select Contact in the Target list.
 
selecting-contact-single-object
11.Click the Next button in the bottom of the dialog box.Click the AccountId field.
12. Click Column and then click Lookup on the drop-down list.
13. In the Lookup Object drop-down list select Account.
14. In the Result Column drop-down list select the ID.
15. In the Lookup Key Column drop-down list select the CSV file column, containing names of parent accounts.
16. In the drop-down list under Column select CompanyName.
 
lookup-contact-account
17. If the names of columns in the CSV file are not the same as Contact field name, map other unmapped fields to the source file columns manually.
18. Click the Finish button.
19. Click the Save button to save the package.

Now your package is ready, and you can run it to import your contacts.