How to add functionality to an Image in Google Document

Sometimes we want to assign some functionality to image instead of the menu item. This could be for many reasons one could be an image in the google sheet could be more harmonious with its theme than a menu item.

One thing that following steps are only for google Sheets and not for google docs or google form.

Following are the steps to follow to add a clickable image in google sheets.

  • Add image to google sheet by selecting Insert-> Image… and the other option is to insert drawing.We can do it by selecting  Insert->Drawing
  • On the image, there is one small drop arrow at top right corner.

  • On clicking it a menu opens. Select assign script.. from that menu

  • It will ask for a name of the script that you want to run on clicking that image.Just provide the name of the script, If you haven’t created the script that you want to run just leave it blank and first create the script.
  • To create script go to tools->script editor… It will open a script editor. there you could add your script. Following is the sample script that will run and give alert message of “”
 function myFunction() {  
   SpreadsheetApp.getUi().alert('You clicked the first menu item!');   
  • Save it and assign the saved script to the image.

Please feel free to ask any query you have in your mind.

Leave a Reply

Your email address will not be published. Required fields are marked *