Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


Google Sheets Buttons & Scripting

  • Please log in to reply
No replies to this topic

#1 chief10


  • Members
  • 4 posts
  • Local time:08:00 AM

Posted 30 November 2016 - 05:13 AM

Hi all, lurker and infrequent poster here with a few questions about scripting buttons in google spreadsheets.

(Please be patient with me - my only relevant-ish experience here is with MatLab)



I am setting up a google sheet for people to suggest items for the office and for others to vote on them. For each item, I want there to be a "yes" tally and a "no" tally, rather than a single tally that takes the difference. In order to stop people from cheating and just filling in a cell with whatever value they want, I am using buttons scripted with Google's apps scripts. (If you haven't used it, this youtube video gives a simple explanation, and is similar to what I'm doing: ).


So far, I have my rows (items) with two buttons each (yes/no). I was hoping there was a way to automate the creation of these buttons, so more are added as people add more suggestions to the bottom of the list. I'm guessing the easiest way would be some master button that "refreshes" and adds the buttons to a row only when the item-name column has been filled in. The problem is, I can't figure out how to create a new button from within a script.


My other concern is how to stop someone from voting on an item more than once, as this spreadsheet will be accessible to them as many times as they'd like. I will be sharing it to our email list, so only someone logged into their email can access this. I'm sure I can track it this way, but I don't know how to get that information (already voted or not) to persist once they close out of the sheet. 


Note I'm specifically doing this in google sheets, as opposed to google forms, in order to allow for them to add suggestions directly to the voting sheet (rather than filling out a form that sends me the suggestion, then me putting the suggestion in the voting form). This might not be the most appropriate forum to ask, but last time I got some amazing help here. Any help/suggestions/other is appreciated!

BC AdBot (Login to Remove)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users