I'm very new at this and I think I'm trying to do something a little complicated. Ultimately I'm looking to do the following: I would like to have a spreadsheet that upon a submit button does the following, sends spreadsheet to a specified email address, then increases a specified cell number by 1, then clears data that was entered in specific cells.
I have figured out how to increase a cell on a button push that's as far as I have gotten. Any chance someone would be able to point me in the right direction?
For your emailing you want to use MailApp.sendEmail()
The PDF conversion mentioned in the subject line is also pretty easy to use Spreadsheet.getBlob() or if you want to be a bit more verbose Spreadsheet.getAs('application/pdf')
Generally the GoogleAPI is pretty good at explaining a lot of the detail on how to connect to the google libraries
Related
I wrote a custom script that takes Google Sheet data and formats it to generate a Google Doc. The sheet data updates automatically and I have to periodically generate a new report for client use. (Overall this relatively seamless -- it has saved me a huge amount of time!)
Unfortunately, I always have to manually format the report afterward, adding column breaks to make sure individual records appear continuously without wrapping to the next column or page. Is there a way to have the script do this for me? So far as I've found, Apps Script doesn't have a way to "figure out" where on the page the cursor is or determine how much room is left before the bottom of the page.
As per Rubén's confirmation in the comments, there is no built-in feature to do what you want. But alternatively, there is a way to do what you want.
This answer shows that similar idea. You can have certain string/keywords that are placed within your source that can define where you would insert your break.
I'm not entirely sure how your data looks and it is hard to provide an exact answer. But if there is a pattern to your data in sheets and you can preemptively define where you can insert your column break, then that can be doable.
Basically, you will need to design how your data is being read (or even modify it) and format it into the document.
If you can provide a sample data and an expected output, then maybe users here can provide you a specific answer that will cater to your exact needs.
Hi I have a shared google sheet where everyone will put values. I need some mechanism that will trigger a popup notification in chrome even if the sheet is not open. This will trigger when a particular cell/column/row value changes.
i searched the web vigorously for some ad dons or script but couldn't find one. everyone i found will send email but i don't need 100, 1000 email. i need just popup/push notification.
i have no background in coding i'm trying to teach myself step by step so elaborated answer will be very appreciated.
so after a lot of searching i found a way, though not working 100% correctly all the time but it can , have to just polish some values and conditions.
there is a service called www.integromat.com they have a great way to almost integrate anything with anything. and this solved the problem.but they are expensive.
they has add on for sheet as well as chrome which can talk to each other with super easy dashboard.
though this is a third party dependent solution i would like to know if it is possible within gsuit and or sheet.
Usually addons are the way to distribute a Google Sheets script, but I do not know if that is a fit for my case:
The user will manually fill out a list of their contacts / friends and answer custom questions about them. So they will, in some sense, definitely need their own copy.
This should scale reasonably well. i.e. O(users) copies of invisible tabs in a sheet is not going to work.
The user should be good to go from clicking a link with minimal work. i.e. a dialog saying "Please make your own copy of this sheet!" and forcing them to fork is not ideal (although I guess it could work.)
Idea #1: manual fork
Very much not ideal to make the user go through that workflow and hard to implement. i.e. the dialog to copy-and-fork will of course be present in the copy so additional logic will be needed to (somehow) de-wire that.
Idea #2: bootstrap + copy
The next idea I have is two apps: 1) an installer that needs access to their Google Drive and 2) the sheet it will copy into their Google Drive.
This is... okay. But I don't like that the user has to authorize an unknown script to have arbitrary access to their Google Drive (!!). Even a more specific question like "add a file to your Drive" would get out of this bind.
The other problem is that the user seeing the example sheet makes it clear what the heck is going on. This should feel as safe as copying a sheet (and be that safe), not like the relative hassle of "installing an app," much less one needing sensitive data.
Idea #3: Obscure addon
I'm not sure if an addon that lives inside of a spreadsheet can be self-discoverable.
But, from there, I believe the addon would unpack the entire structure of the sheet from script. This is something I can handle, even though it seems kludgey still. And this may even require the user having a blank sheet ready first?
Initially I asked about tracking forks. Now I am much more ambitious in that I am looking for an actual proper distribution mechanism that is not asking users to just manually fork everything.
https://support.google.com/docs/answer/91588?hl=en
I have a Sheet where the the cells are filled in with data that is pulled via Apps Script, which they get from a website. Sometimes they pull in the exact same data, sometimes not. On the old Sheets version I use to be able to get emails when the data only "changes" to a different value. Now with the new Sheets, I get an email when new data is pasted into the cells, even though its the exact same data......and, I can't set it to look at ranges anymore, only the entire document. Is there an easy way to watch cells for when the data changes, and then email myself?
This looks a lot like what you're trying to do.
For checking whether the value has truly changed after the edit, this gives you all the necessary information about it. Hence, you would know whether the new value is the same one or not. Implementing the "workaround" talked about in the second link, I was able to compare and send an email to myself if the value changed. Initiate an onEdit trigger that goes off for your onEdit function which uses these lines after all the checks in place have passed.
var email = "xyz#whatever.com";
MailApp.sendEmail(email, "TriggerMail", "A change has occurred in the Sheet");
NOTE: This only sends you a "notification" sort of an email but you can even include the changed values in the email easily by just following this tutorial.
I am hoping i can find a kind hearted person to help me if possible with some google sheets scripting.
I am looking for a way to automate something i currently have to do manually everyday. I take data from present day I have entered into a spreadsheet, copy it, paste it into and email and send it. I have used the Query function within Google sheets to help me separate who gets what information, that has made my life a tad bit easier.
I currently go to each tab, copy data, go to Gmail, paste data, type in the email address of the recipient, type in the subject, send, then go on to the next one 30+ times.
What I would like to do...
1. Click a menu item at top that says something like "Send Emails Now"
2. Once triggered, this would go to all (except 3, but i can just have these go to my own junk mail if too much) the tabs and send an email with the information contained only on that sheet to an email address in Cell A2
Email would have the subject "Call Parking Time XXXXXX" where XXXX is the date in a E1
Here is a copy of the current sheet I have, some reason it will not let me share the original. So i have updated the 20-Sioux Falls and 21-Frederick sheets to show what i mean.
https://docs.google.com/spreadsheets/d/1nOgZzwbKEUF4_adkjxkvmiiVwFtu-2OGCPJ0Wj_keQU/edit?usp=sharing
Thank you for your help in advance.
Although this is an older question, I still have a recommendation for you and other potential users facing the same problem.
I use a Google Sheets add-on called FormMule that should work as a great solution to your challenge here. It allows you to create personalized template emails, set conditions for your merge, and have multiple templates to various people based upon your chosen criteria.
You can also set a time trigger, form submission trigger, or manually trigger it through the add-on menu.
Although I agree with Zig, here are a few things that'll help you get started:
//1. Define your Custom Menu Item
function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{name: 'Send Data', functionName: 'sendEmail_'}
];
spreadsheet.addMenu('Automated Emails', menuItems);
}
Tutorial for Sending Email (Although this one sends data in each row as a separate email but you should get the idea of what to do)
Sample for creating a table from Spreadsheet Data
This should give you a good head-start. Put pieces of these together and you should be pretty much good to go. And if you hit any roadblocks along the way, people on SO are always glad to help. :)