0

Peace Be Upon You,

I need some help with google app scripts.

What I want to do:

  1. I want to add an image in google sheets
  2. Add an app script to this image
  3. Configure the script so that when I click the image it takes me to a url (external or internal)

What Help I need: I'm a beginner and would like to get the work done. Please help me with a sample or template code to place the url.

Why app script for this simple task: Google sheets kept no other way to point a drawing or image to a url. I've tried everything.

I’m new here. Please forgive me if asking this way is against manners. But please help me.

Thanks,

Md. Iftikhar Alam Omar

https://iftikharomar.co

1 Answer 1

1

Step 1: Insert the image.
Step 2: Create the following in the script.

function btnClick() {
  var html = "<script>window.open('https://google.com');google.script.host.close();</script>";
  var userInterface = HtmlService.createHtmlOutput(html); 
  SpreadsheetApp.getUi().showModalDialog(userInterface, 'Loading...');
}

Step 3: Right-click on the image, then hit the 3 dots in the upper right-hand corner. Click assign script and type btnClick in the box.

See this Google Sheet for a functional example.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.