I have a google sheet that uses an app script button to send the values from that sheet to another sheet. If someone forgets to press enter after filling in their information, it will not send the last cell value.
So if the cell previously had the value of 3, then we change it to 4, but don’t press enter, it will send the value of 3.
The solution, I think, is at the beginning of the function for it to submit somehow, or press enter, or select another cell, anything that works. But I can’t figure out how to do that so far.
I’ve tried various things but I can't find the right apps script function.
So far without pressing enter, or clicking on another cell, I am unable to access that cell value. Changing the active selection doesn't work.
const sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("L1");
// change the active selection to another cell, but it just moves the 4 to the new cell
sh.setActiveSelection('A1');