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.