Disabling/re-enabling a button made from sheets using scripts


Joined
Nov 9, 2022
Messages
2
Reaction score
0
I am not sure how to disable a button (saveRecord) after one click created on google sheets with google apps script code attached. I also need help with re-enabling the button (saveRecord) through the click of another button I created (newRecord). This is the script I have created so far for a form I am making. I've exhausted all my resources and have only found information on how to create a button... :(

Thanks!

function saveRecord() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const practiceWS = ss.getSheetByName("practice")
const responsesWS = ss.getSheetByName("responses")
const idValue = practiceWS.getRange("C5").getValue()
const fieldRange = ["C5","C7","C9","F3","C3","F5","F7","F9","F11"]
const fieldValues = fieldRange.map(f => practiceWS.getRange(f).getValue())
//console.log(fieldValues)
responsesWS.appendRow(fieldValues)
//
}

function newRecord() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const practiceWS = ss.getSheetByName("practice")
const responsesWS = ss.getSheetByName("responses")
const idValue = practiceWS.getRange("C5").clearContent()
const fieldRange = ["C5","F3","C3","F5","F7","F9","F11"]
fieldRange.forEach(f => practiceWS.getRange(f).clearContent())
idValue.clearContent()

}
 
Ad

Advertisements

Joined
Nov 24, 2022
Messages
24
Reaction score
0
What are the possibilities of such technics? What can I achive with this? I't doesn't look like having fun for me. Exhausting and boring.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top