0

I created a new submenu on the toolbar. I want to have several drop down items each with their own assigned image so that when someone clicks their name an associated image from the Drive automatically appears in the cell. How do I do this? This is what I have so far:

    function onOpen() {
      var ui = SpreadsheetApp.getUi();
      // Or DocumentApp or FormApp.
      ui.createMenu('Supervisor Signatures')
      .addItem('First item', 'menuItem1')
      .addSeparator()
      .addSubMenu(ui.createMenu('Sub-menu')
          .addItem('Second item', 'menuItem2'))
      .addToUi();
     }

function menuItem1() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
     .alert('You clicked the first menu item!');
}

function menuItem1() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
     .alert('You clicked the first menu item!');
}

1 Answer 1

1

Looked around the community and found this post on Using Google Script, how can I insert an image into a table cell?.

The answers simply mention to just do a function that sets the cell formula to -- =Image(<insert-image-url-here>) with getRange(<insert-cell-here>).setFormula();

Regarding using the images from your Drive, here's a simple and quick guide on how you can Get Images from Google Drive

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

1 Comment

I think this page on Adding Images to Google Spreadsheet would also be helpful for you.

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.