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 Answers1

0

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

Nimantha
  • 6,405
  • 6
  • 28
  • 69
AL.
  • 36,815
  • 10
  • 142
  • 281
  • I think this page on [Adding Images to Google Spreadsheet](http://www.labnol.org/internet/images-in-google-spreadsheet/18167/) would also be helpful for you. – AL. Mar 31 '16 at 23:29