0

I'm creating a spreadsheet that lets a user select an item from a custom menu, then automatically populates the sheet with relevant data for the item they chose to add. Think of it like a configurator for a burger, where users can click "Add tomato" and the spreadsheet automatically creates a line item for tomato and adjusts the total cost of the burger at the bottom.

I also need a way to selectively delete items the user no longer wants.

I'm trying to insert an image next to each item that resembles an X symbol, and attach code to that image that will delete the corresponding item and all associated data.

The insertImage() function doesn't seem to allow this. Any ideas?

Thanks for any help!

1 Answers1

0

You have two options:

  1. You can manually create a button (an image with a script linked). Click the arrow at the top right of an embedded image and select "Assign script..."

enter image description here

  1. You can program your own add-on (or find an add-on that someone else created that does the exact thing you're looking for). See https://developers.google.com/apps-script/quickstart/docs

At this time it is not possible to attach a script to an image that was added using Google Apps Script

Also addressed in Adding Buttons To Google Sheets and Set value to Cells on clicking

Community
  • 1
  • 1
Scott
  • 3,663
  • 8
  • 33
  • 56