Play Sound when a specific cell change the Value google sheets


I am trying to run the code of this post, :

Google Script: Play Sound when a specific cell change the Value

with the recommendation of Rob Blakemore

Could someone pass me a sheet that is working with this code?

I have tried to test this code in a sheet and it does not work for me.

it only sends me the message: Checking for calls…

I send you the link of my sheet:

this is the code of the appscript:

// creates a custom menu when the spreadsheet is opened
function onOpen() {
  var ui = SpreadsheetApp.getUi()
    .createMenu('Call App')
    .addItem('Open Call Notifier', 'openCallNotifier')

  // you could also open the call notifier sidebar when the spreadsheet opens
  // if you find that more convenient
  // openCallNotifier();

// opens the sidebar app
function openCallNotifier() {
  // get the html from the file called "Page.html"
  var html = HtmlService.createHtmlOutputFromFile('Page') 
    .setTitle("Call Notifier");

  // open the sidebar

// returns a list of values in column H
function getColumnH() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Support");

  // get the values in column H and turn the rows into a single values
  return sheet.getRange(1, 8, sheet.getLastRow(), 1).getValues().map(function (row) { return row[0]; });


<!DOCTYPE html>
    <base target="_top">
    <p id="message">Checking for calls...</p>

    <audio id="call">
      <!-- <source src="" type="audio/mp3"> -->

<source src="" type="audio/mp3">

      Your browser does not support the audio element.

    var lastTime = []; // store the last result to track changes

    function checkCalls() {

      // This calls the "getColumnH" function on the server
      // Then it waits for the results
      // When it gets the results back from the server,
      // it calls the callback function passed into withSuccessHandler (columnH) {
        for (var i = 0; i < columnH.length; i++) {

          // if there's a difference and it's a call, notify the user
          if (lastTime[i] !== columnH[i] && columnH[i] === "Call") {

        // store results for next time
        lastTime = columnH;


        // poll again in x miliseconds
        var x = 1000; // 1 second
        //window.setTimeout(checkCalls, x);

    function notify() {

    window.onload = function () {

    function timer(ms) {
   return new Promise(res => setTimeout(res, ms));

  async function loopthis () { // We need to wrap the loop into an async function for the await call (to the Promise) to work.  [From web: "An async function is a function declared with the async keyword. Async functions are instances of the AsyncFunction constructor, and the await keyword is permitted within them. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains."]
    for (var i = 0; i >= 0; i++) {
      console.log('Number of times function has been run: ' + i);
      await timer(3000);

  window.onload = function () {



In your script, how about changing the endpoint of the mp3 file as follows?


<source src="" type="audio/mp3">


<source src="" type="audio/mp3">
  • In this case, webContentLink is used.


  • When I tested your script by reflecting this modification, I confirmed that your mp3 file was played.

Answered By – Tanaike

Answer Checked By – Senaida (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.