I have a Google Sheet that I want to check if an email address already exists in my list of Contacts.
I wrote an Apps Script with this function
function isAContact(email) {
if (null != ContactsApp.getContact(email)) {
return 1;
}
return 0;
}
If I run this function directly in Google Apps Scripts it works fine, after it asked for permission on the first run.
When I call this function in Google Sheets
=isAContact(H4) // H4 is a cell with an email address
it complains that the permission to call getContact() is denied.
How can I allow this spreadsheet to use the Contacts Api?