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 specify parent accounts for contacts, first you need to create a connection to the target Salesforce if you haven’t created it yet. To create a connection to Salesforce, perform the following steps:
- Click +NEW in the top menu.
- Click the Connection button in the menu on the left.
- In the opened Select Connector page, select Salesforce. To quickly find it, you can either use the Type to filter box or filter connectors by categories using the All list (for Salesforce, select the CRM category).
- The default name of a new connection is Untitled. Just click it to rename the connection, for example, to Salesforce1.
- 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.
-
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.
-
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 Sign 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.
-
Click Create Connection.
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:
- Click +NEW in the top menu.
- In the Integration column, click Import. The import package details page will open.
- Rename your package by clicking and editing the package name. The default package name is Untitled. Please note, if you omit this step, the package name will remain Untitled in the list of created packages.
-
Under Target, in the Connection list, click Select target and select Salesforce connection from the drop-down list. You can use the Type to filter box to quickly find the necessary connection.
- Click the Add new link to open the Task Editor.
-
Drag your file to the drop here your file area or click the browse link and upload the CSV file with Contacts data to import.
-
Specify the CSV options if necessary.
- Click the Next step button in the bottom of the dialog box to switch to the next editor page. You can also switch between the editor pages by clicking the corresponding icons: Source Definition, Target Definition, and Mapping Definition.
-
In the Target list, select Contact.
- Click the Next step button in the bottom of the dialog box to switch to the next editor page or click the Previous step button to return to the previous page.
- Click the AccountId field.
- Click Column and then click External ID on the drop-down list.
- In the Source Column drop-down list, select the CSV file column, containing external id values, determining parent accounts.
-
In the External ID Column drop-down list, select the Account external ID field name.
- 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.
- Click the Save button to save the task.
- Click the Create button to create 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:
- Click +NEW in the top menu.
- In the Integration column, click Import. The import package details page will open.
- Rename your package by clicking and editing the package name. The default package name is Untitled. Please note, if you omit this step, the package name will remain Untitled in the list of created packages.
-
Under Target, in the Connection list, click Select target and select Salesforce connection from the drop-down list.
- Click the Add new link to open the Task Editor.
-
Drag your file to the drop here your file area or click the browse link and upload the CSV file with Contacts data to import.
-
Specify the CSV options if necessary.
- Click the Next step button in the bottom of the dialog box.
-
In the Target list, select Contact.
- Click the Next step button in the bottom of the dialog box.
- Click the AccountId field.
- Click Column and then click Target Lookup in the drop-down list.
- In the Lookup Object drop-down list, select Account.
- In the Result Column drop-down list, select the ID.
- In the Lookup Key Column drop-down list, select the column from the Account table.
-
In the drop-down list under Column, select Company name from CSV file.
- 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.
- Click the Save button to save the task.
- Click the Create button to create the package.
Now your package is ready, and you can run it to import your contacts.