![]() You can extend this project with other Lookup packages like line type intelligence. The script will take a few seconds to run but you'll quickly see the validation information in the spreadsheet! Some members of my group chat seem to be operating in a different universe, but at least now I know. Validate any "Authorization Required" prompts to grant access to your sheet. It might take a moment but you will see a new menu item called "Validate Phone Numbers".Ĭlick on "Validate Phone Numbers" then "Validate All". Save the Apps Script (you do not need to deploy it) then go back to your sheet and refresh the page. ![]() Run the validation script from your sheet Finally, onOpen will create a handy menu item so you can call this script from your spreadsheet directly. The validateAll function loops through all of the rows in the spreadsheet (assuming you have one header row) and runs the validate function on each row. You could include other data from the Lookup API, check out the documentation to see what else is returned. This includes the phone number in a standardized E.164 format and whether or not the phone number is valid. ![]() The validate function is doing the bulk of the work to call the Lookup function and write the response back to the sheet. You may need to change these depending on what your data looks like, so if your phone number is stored in Column G, your variable would be let PHONE_NUMBER = 6. These will be used to pull the right information to feed into our function and tell our App Script where to write the data we get back from our function. The first handful of lines starting with let PHONE_NUMBER =. Importantly, instead of /index.html, use /lookup to call the function that's doing the work behind the scenes. Replace the placeholder Lookup URL on line 9 with the URL of your deployed function from the last step. Then replace all of the text that starts with function myFunction with the following: It will open up a screen like this:įirst, change "Untitled project" to something like "Phone Number Validation". Open your Google Sheet and navigate to Apps Script from the Extensions menu. The next step is to use Google's built in Apps Script, based on JavaScript, to call out to your Lookup function from your spreadsheet. Create an App Script in your Google Sheet Keep this page open while we build the rest of the integration - you'll need the URL shortly. You'll be redirected to a handy interface where you can look up any phone number with optional data packages like line type or caller name information. Once the project is deployed, click on the "Go to live application" button. Head over to the CodeExchange and deploy the Lookup project. Functions protect your Twilio Credentials, so you don't have to worry about storing those in your Google Sheet.You can deploy the Lookup function quickly using CodeExchange.Functions are hosted on Twilio for easier management.Instead of calling the Twilio API directly from Google Sheets, this tutorial uses Twilio Functions. Create a Lookup function to call from Google Sheets
0 Comments
Leave a Reply. |