How to Update Lead Data Using API: Google Sheets Example
This article shows an example of how a Google Spreadsheet can be used to update lead data on a site using the site's API.
Checklist Before Moving Forward With This Example
1) Make sure to generate a unique API Key using the documentation down below as a guideline. Please make sure to save the API Key in a safe place as it is not accessible after it has been created:
2) Prepare a Google Spreadsheet with at least two essential columns: one for the lead's ID# (the lead_id variable) to reference an existing lead on the site, and another for the variable to be updated. For example, if the lead currently has the lead name "Test name" and needs to be updated to "John Doe", specify these details in the spreadsheet.
Note: The column names do not necessarily match with the correct database variable names as this can be mapped later on.
How To Connect Google Sheets Using Zapier
In this example, we will be using Zapier to integrate Google Sheets into the Brilliant Directories site.
Log in to the Zapier account and click on Create Zap:
Name the new zap created and select the Google Sheets option as a Trigger:
Select the Event type as New Spreadsheet Row and click on Continue:
Connect the Google Sheet Account (this would be a Gmail account) and click on Continue:
Choose the preferred Spreadsheet, specify the Worksheet, and click on Continue:
Click on Test Trigger:
There will be a confirmation that a spreadsheet row has been found, click Continue:
Now the Trigger has been set up correctly, the Action can be created. Search and select the "Brilliant Directories" as the App option:
Choose the Event as the Update Lead event and connect the Account:
Select "Connect a new account":
This will open a new window where the domain of the site (https:// or http:// included) and the API Key generated can be specified:
Next, we will be setting up the action. In this section, all the available lead variables can be found. As we already created a spreadsheet with a row of lead data, the next action would be mapping/matching the column names to the correct variable names.
Select the "Custom" option for the Lead ID field and select the lead_id value from the spreadsheet:
Then, map the Lead Name by selecting the lead_name column for the "Lead Name" field:
Now that all the preferred variables are matched and mapped correctly, click on Continue to test the action:
Confirm that the information displayed is correct and click on Test Step:
Make sure that the targeted field is updated:
Once confirmed, click on "Publish":
Note: Going forward, any new rows added to the connected Google Sheet via the API will automatically update the corresponding member data.