O'Reilly logo

Learning Google Apps Script by Ramalingam Ganapathy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a Gmail Contact search application

Now, we will create an application to search existing contacts. This application is able to search and list your Gmail Contacts in Sheets. Create a new Sheet and rename Sheet1 to Contacts and set it up as shown in the following screenshot. Create a button and assign the function name searchContacts to it, as you learned in the previous chapter.

Building a Gmail Contact search application

Create the searchContacts function as listed here:

function searchContacts(){ var SheetContacts = SpreadsheetApp.getActiveSpreadsheet() .getSheetByName("Contacts"); // Read input from cell A3 var searchCriteria = SheetContacts.getRange("A3").getValue(); // First 10 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required