Skip to content

How to use the Google Sheets integration?

Nioleads can integrate directly with Google Sheets to add powerful formulas, allowing you to find & verify emails as easily as doing a =SUM function.

The available formulas are then:

  • =FINDEMAIL(name, domain) to find an email from name + domain
  • =VERIFYEMAIL(email) to verify an email

Setup Nioleads Apps Script in Google Sheets

  1. Open a Google spreadsheet and click on Extensions > Apps Script

open google sheet apps script

  1. Paste the below script in Code.gs

apps script edit code

var BASE_URL = "https://api.nioleads.com/v1/openapi";
var API_KEY = "YOUR_API_KEY";
/**
* Get email from name + domain
*
* @param {string} name Person's name
* @param {string} domain Company domain or website
* @return Email address
* @customfunction
*/
function FINDEMAIL(name, domain) {
try {
var response = UrlFetchApp.fetch(BASE_URL + "/find_email", {
method: 'POST',
"headers": {
"Authorization": "Bearer " + API_KEY,
"Accept": "application/json",
},
contentType : "application/json",
payload: JSON.stringify({
name, domain
})
});
var result = JSON.parse(response.getContentText());
return result.email ? result.email : 'not found';
} catch (err) {
return "Uh oh! Something went wrong. Check your API credentials and if you're passing the correct parameters";
}
}
/**
* Verify an email for bounce
*
* @param {string} email Email address to verify
* @return Deliverability status
* @customfunction
*/
function VERIFYEMAIL(email) {
if (email == '') return '';
try {
var response = UrlFetchApp.fetch(BASE_URL + "/verify_email", {
method: 'POST',
headers: {
"Authorization": "Bearer " + API_KEY,
"Accept": "application/json",
},
contentType : "application/json",
payload: JSON.stringify({
email
})
});
var result = JSON.parse(response.getContentText());
return result.status || 'error';
} catch (err) {
return "Uh oh! Something went wrong. Check your API credentials and if you're passing the correct parameters";
}
}
  1. Replace “YOUR_API_KEY” by your Nioleads API key

use nioleads apikey in apps script

If you don’t have a key yet you can create one at https://app.nioleads.com/integration

  1. Click on Save project

save apps script

Make sure there isn’t other lines than the one you copied eg. remove any “myFunction()” line etc.

Using the Email Finder formula in Google Sheets

  1. You can now use the FINDEMAIL and VERIFYEMAIL formula as any other Google Sheets formula

use FINDEMAIL AND VERIFYEMAIL formula

  • For FINDEMAIL formular, the first parameter is the person’s full name, the second parameter is the company website or domain.
  • For VERIFYEMAIL, the first parameter is the email to verified.
  1. Select the right cells for the parameters and press enter to get the email

enter the FINDEMAIL parameters