Create a Button that works in mobile in Google Sheets

Create a Button that works in mobile in Google Sheets

Practical Sheets

1 год назад

31,756 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@andrewsworkshop
@andrewsworkshop - 12.12.2023 02:39

Thank you so much! This worked for me. :)

Ответить
@SilverPazuzu
@SilverPazuzu - 07.12.2023 13:13

Amazing, this helped me a lot! :)

Ответить
@gilmarferro5228
@gilmarferro5228 - 25.11.2023 18:21

Procuro algo assim para menu de navegação. Alguém já desenvolveu algo ?.

Ответить
@AllinOne-ze8ku
@AllinOne-ze8ku - 18.11.2023 14:37

I need a help.can you please help me?

Ответить
@so_slow
@so_slow - 13.11.2023 17:57

thank you so much this works so well!

Ответить
@georgealvarez5981
@georgealvarez5981 - 22.10.2023 23:44

OMG thank you so much! This is exactly what i need... i'm creating a worksheet for testing spanish conjugation and i need to be able to clear the answers from the spreadsheet after every use (1 student, my partner, who wants to use this for practice drills). I copied your code but left out the sheetName requirement, and i feel like i've gotten all the code right, but it's not getting activated on edit.
I've run the OnEdit manually from the Apps Script and it works when i have the correct checkbox marked, but when i go to the actual spreadsheet and click the checkbox it's not doing anything. I was wondering if you or anyone else had any thoughts on this. My functions work when i run them manually or when i run them using the buttons i made. Here's my code! (please don't make too much fun of my code i'm a newb 😅)

/** @OnlyCurrentDoc */
function OnEdit() {
let activeCell = SpreadsheetApp.getActiveSpreadsheet().
getActiveCell()
let reference = activeCell.getA1Notation()
let activeValue = activeCell.getValue()
if (reference == 'F3' && activeValue == true) {
ClearColG()
}
}

function ClearColG() {
var sheet = SpreadsheetApp.getActive();
sheet.getRange('G:G').clearContent();
sheet.getRange('F3').setValue(false);
}

function UncheckAll() {
var sheet = SpreadsheetApp.getActive();
sheet.getRange('H:H').setValue(false);
}

Ответить
@richardthemagician8991
@richardthemagician8991 - 01.10.2023 05:11

This is great. On one issue. I added the counter to my already existing sendEmail function. I commented out the for loop so it would send a hundred emails while I tested this thing. It working perfectly. But then I removed the comments /**/ from the loop and not it isn't working. Any suggestion? For your reference, the sheet is "Campaign" and the checkbox cell is H2.

function sendEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Campaign');
var range = sheet.getRange('B10:B');
var values = range.getValues();
let counter = sheet.getRange("F2");

counter.setValue(counter.getValue()+1);

for (var i = 0; i < values.length; i++) {
if (values[i][0] === false) {
var recipientEmail = sheet.getRange('G' + (i + 10)).getValue();
var replyToEmail = sheet.getRange('M' + (i + 10)).getValue();
var subject = sheet.getRange('O' + (i + 10)).getValue();
var message = sheet.getRange('N' + (i + 10)).getValue();

MailApp.sendEmail({
to: recipientEmail,
replyTo: replyToEmail,
subject: subject,
body: message
});
}
}
}

function onEdit(){

let activeCell = SpreadsheetApp.getActiveSpreadsheet().getActiveCell()
let reference = activeCell.getA1Notation()
let sheetName = activeCell.getSheet().getName()
let activeValue = activeCell.getValue()

if(reference=="H2" && sheetName=="Campaign" && activeValue==true){

sendEmails()
activeCell.setValue(false)

}

}

Ответить
@mpatey84
@mpatey84 - 30.09.2023 21:18

Thanks for this, I have attempted to utilize this in my script but I have not had any luck getting it to work. I am fairly new to the scripting and I am not sure how to go about troubleshooting, I have copied your script exactly other than the counter. any recommendations would be great.

Ответить
@air961
@air961 - 15.09.2023 09:37

Thanks!

Ответить
@sbarbee1979
@sbarbee1979 - 25.08.2023 22:42

This video was great and easy to follow along. Much appreciated actually talking through the meaning of the commands used also!

This seems like the ideal fix for my situation , but I was unable to get it to work in the last step (with the checkbox). My script runs within the basic onEdit function, but when I try to tie it to the specific trigger, it no longer executes (nothing happens). I've compared my code to the video's 5-6 times and don't see any differences. Thoughts?

Ответить
@sjjsk2496
@sjjsk2496 - 21.08.2023 07:01

In mobile, custom dialog is still not showing up, is there a solution for that?

Ответить
@harunyldz5763
@harunyldz5763 - 12.08.2023 22:49

How about a function that access another file in drive? This code doesn’t work for me.

Ответить
@jonnybolton4659
@jonnybolton4659 - 10.08.2023 16:14

Hi, thanks for this tutorial it's very helpful, I managed to copy it so that my counter function worked on my tablet, however when I replace counter with my own function in the script, it no longer runs... but that function works fine when placed in a button or as a keyboard shortcut.

Can you think of any limitations on why the onEdit function won't run another function? Would it help if I shared the code for that function with you?

Ответить
@finnigan16
@finnigan16 - 10.08.2023 07:35

Very helpful. Thank you!

Ответить
@aaronbitton9310
@aaronbitton9310 - 25.07.2023 08:34

That was incredible! Thank you!

Ответить
@user-ic3oj8hj2b
@user-ic3oj8hj2b - 10.07.2023 18:39

My god I've been searching for this fo soooo long. It works perfectly well on my phone, and will help all of my coworkers. Thank you so much for sharing this !!!

Ответить
@maurobatti
@maurobatti - 10.07.2023 06:00

Thanks, great idea

Ответить
@med1607
@med1607 - 04.07.2023 20:02

Thank you so much for your video. It didnt work for me. I'm not sure why. My desktop buttons work but I cannot get the script to work for the edit you made. Any thoughts? I would love to share with you the code I am using. I cannot find any information on how to get it to work any where else. Your video was the closest thing I've found.

Ответить
@user-oe4zu9kc8r
@user-oe4zu9kc8r - 19.06.2023 18:33

This is perfect, how would this work if you have several buttons that all do the same thing, add 1 but are in different cells and for different cells?

Ответить
@user-cc9eo9zk1n
@user-cc9eo9zk1n - 02.06.2023 16:32

Can you create a video of how to use this button with your video “WORKOUT LOGGER GOOGLE SHEET”

Ответить
@christophe4604
@christophe4604 - 29.05.2023 23:07

That's perfect, thanks a lot !

Ответить
@puthdarakim1175
@puthdarakim1175 - 21.05.2023 06:56

Could you help to use checked box on mobile to move / copy many rows to another sheet

Ответить
@puthdarakim1175
@puthdarakim1175 - 21.05.2023 06:54

Very good,

Ответить
@brearddominique64400
@brearddominique64400 - 05.05.2023 11:57

Very interesting. Thanks

Ответить
@BraveHeart-ht8zf
@BraveHeart-ht8zf - 28.04.2023 04:46

this Tutorial is useful

Ответить
@joshuasantora4112
@joshuasantora4112 - 27.04.2023 19:55

How can I add multiple buttons to the same sheet like this? I've tried but something is interfering to where the last one in the script code is the only one that's actually functioning.

Ответить
@DimoMinkov
@DimoMinkov - 15.04.2023 13:17

Thanks! How will it be implemented if there are several buttons and correspondingly several scripts (functions) in the table?

Ответить
@katherineberger3130
@katherineberger3130 - 24.03.2023 05:10

Thank you so much! This is exactly what I was looking for :)

Ответить
@jonisarowar8424
@jonisarowar8424 - 23.03.2023 10:18

That was amazing!! 😍

Ответить
@lafamillecarrington
@lafamillecarrington - 23.03.2023 01:37

Useful to know that there is a relatively simple workaround.
Thanks.

Ответить