Clickable Phone numbers in Google Docs
Asked Answered
R

2

14

Is there a way to make phone numbers clickable in Google Docs similar to MS Word like here?

Please note that this can be done in Google Sheets using:

=HYPERLINK("tel:1234567890", "Call Me")

I am asking for Docs.

Thank you.

Roundel answered 26/11, 2019 at 19:55 Comment(3)
does not seem to work on Google SheetsPneumothorax
@FredericBazin is right, it is not working in Google Sheets. Help explains why: «Only certain link types are allowed. http://, https://, mailto:, aim:, ftp://, gopher://, telnet://, and news:// are permitted; others are explicitly forbidden. If another protocol is specified, link_label will be displayed in the cell, but will not be hyperlinked.»Cutis
Yes, you are right, =HYPERLINK("tel:1234567890", "Call Me") doesn't work anymore.Roundel
S
14

Google Docs now supports call/telephone links by adding a hyperlink with tel followed by the phone number.

Example

  • U.S. - tel:1234567890
  • Int'l - tel:+11234567890

When clicking the link the browser displays a call prompt.

Subtropical answered 3/4, 2022 at 19:13 Comment(2)
Google Docs was already supporting this at the time of my question. I'm asking for Sheets.Roundel
Docs may support this however I'm unable to find documentation support in in Forms/Sheets as @Roundel mentioned.Utilitarianism
I
8

Unfortunately, there's no direct way of doing this, but you can use Apps Script and deploy a web application that will solve your issue.

You will have to use this script using Apps Script script editor:

function doGet(e) {
  return HtmlService.createHtmlOutput("<script>window.location.href='tel:" + e.parameter.tel + "';</script>");
}

The code contains a doGet(e) function which sends an HTTP GET request and returns a new HtmlOutput object, which has as a parameter the phone number of your choice.

Afterwards, you have to deploy this script as a web application and after that, you will get a URL corresponding to it.

If you want to use it in Google Docs, you can create a link made out of the following link:

your-web-application-URL+?tel=the-phone-number-you-want .

Furthermore, here are some links for you that might be of help:

  1. Apps Script;

  2. Google Web Apps;

  3. HtmlService Class;

  4. Create a link in Google Docs.

Ingaingaberg answered 19/12, 2019 at 9:14 Comment(2)
while the following works on desktop, it does not work on mobile (neither iOS nor Android) :( do you have any idea why, just in case?Forelimb
Can you elaborate what to do after you create the web app? I created the script and deployed as a Web App. I got a link to the web app that looks like this: script.google.com/a/macros/xyz/exec Then I created a hyperlink as follows: HYPERLINK("script.google.com/a/macros/xyz/exec?tel=" &A1, A1) where A1 is the Googlesheet cell with the phone number. When I click on the link, I end up with a blank google page.Ikeda

© 2022 - 2024 — McMap. All rights reserved.