Sync Google Contacts with QuickBooks

The CData ADO.NET Providers offer an easy way to integrate with different data sources. This article walks through the included, fully functional application that can be used to synchronize contacts between Google and desktop editions of QuickBooks. The application can easily be modified to synchronize contacts with QuickBooks Online and QuickBooks POS.

Connecting to QuickBooks and Google

To connect to Google, you will need to use the OAuth standard. You will need to register an app to obtain the OAuth client Id and client secret. You can then set InitiateOAuth to complete the OAuth process. When you connect, the provider will open the URL to the Google OAuth endpoint in your default browser. After logging into Google, you will be prompted to grant permissions to the application. See the "Getting Started" chapter in the help documentation for a guide to obtaining the OAuth authentication values.

To connect to QuickBooks Desktop and QuickBooks POS, specify the User, Password, and the URL of the Remote Connector. To connect to QuickBooks Online, you will need to obtain the OAuth authentication values.

For guides to connecting to your edition of QuickBooks, see the "Getting Started" chapter in the help documentation.

Getting the Contacts

Follow the steps below to define simple SELECT queries to retrieve the Google and QuickBooks contacts.

  1. To obtain a list of a user's Google Contacts, issue a query to the Contacts table. For example:
    SELECT * FROM Contacts
  2. QuickBooks stores contact information in multiple tables. Depending on your use case, you may want to synchronize your Google Contacts with QuickBooks Customers, Employees, Vendors, or a combination of the three. To get data from a specific table, issue a SELECT query to that table. For example:
    SELECT * FROM Customers
  3. Retrieving all results from QuickBooks may take some time, depending on the size of your company file. To narrow your results, you may want to use a filter by including a WHERE clause in your query. For example:
    SELECT * FROM Customers
    WHERE  (Name LIKE '%James%')
    AND IncludeJobs = 'FALSE'

Synchronizing the Contacts

Synchronizing the contacts is a simple process. Once the contacts from Google and the customers from QuickBooks are available, they can be compared and synchronized based on user preference. The sample application does this based on user input, but it is easy to create one that does the synchronization automatically. The standard SQL syntax makes it easy to create, update, or delete contacts in either data source as needed.

Demo Application

The executable for the demo application can be downloaded here.

Source Code

You can download the full source of the demo application here. You will need the Google ADO.NET Data Provider and the QuickBooks ADO.NET Data Provider.