Monitoring a google sheet for changes and validating data - google-sheets

Problem: Write a program that creates a spreadsheet and constantly monitors it for changes. Any row that contains "invalid data" (according to a rule defined by a regex) in one of the columns should be deleted. For example, lets say that column A must be a valid date, while all the other columns can hold arbitrary data. Then, if someone enters an invalid date into cell A5, all the data in row 5 should be removed.
Attempted solution:
The program will have to deal with a lot of data, so when i am monitoring the sheet, i would like to obtain changes made to the spreadsheet as just the change. That is, i dont want to have to request the entire spreadsheet of data every time an edit is made. The only way that i have found to obtain only edits is through google apps script, but i have not found a way to create a spreadsheet along with an apps script bound to it. Is this possible through google apis, or is there a better way to tackle this problem?
I also looked into data validations as a possible solution, but I cannot find a setting that deletes an entire row when one specific column is invalid.

Related

APPSHEET move entire data to first row when data is updated/added

In my google sheet, I created a script that everytime a new data added or edited it will automically move it to the first row in my google sheet. What I want is when everytime I update a data or add a new data using the Appsheet, it will also automatically move it to the first row in my google sheet data
It's common when people are first starting to integrate AppSheet into their workflows, that they still rely on their spreadsheet as their primary interface.
You might consider changing where you're doing the bulk of your user interaction, changing it from the spreadsheet into AppSheet itself.
Inside AppSheet, you can easily sort the views of your sheet, basing everything off of a timestamp - so the most recently updated record is always visible at the top of the table
Doing it this way means you're just displaying your data, you're not actually modifying the data.

Copying an automatically created tab to another google sheet file

I'm working in the Google sheets on two files.
The first one is the output from a database and it's automatically refreshed every hour. When it's refreshed, it's saved as a separate tab named with the timestamp. The previous tab (the one with the data from the previous refresh) is deleted.
The second one contains some calculations based on the data from the first file. I copy the data from the first file to the second one, because I can't modify the data in the first one. Currently it's done manually by me.
My question is: is it possible to automate copying the data from the first file to the second one so that the second file will always have up to date data? If yes, can you please show how can I do it?
You can also try this (which actually a modified version given by player0)
=IMPORTRANGE("url_of_sheet_or_id"; "A1:C10")
You mention: "The first one is the output from a database"
When no sheet is defined, Google Sheets will pick up ranges from the first sheet.
Prerequisite
The most recent sheet must be the first one (far left).
If it isn't, you should "direct" your database to place the most recently created sheet as the very first one (or use a script).
use IMPORTRANGE. example:
=IMPORTRANGE("url_of_sheet_or_id"; "sheet_name!A1:C10")

Sharing a created Google form with linked sheet for others to use

I have created several systems with Google Forms (and linked sheets) to log services provided and timekeeping. I would like to share these systems with other people to use as a template for their own data. Is there a way to easily do this keeping my formula's intact?
Successfully: I have found a way to share the form only as a template by copying the URL into an emailed hyperlink changing the ending from edit to copy.
Cumbersome but ok Migrant Service Log: This method does not seem to work entirely for spreadsheets. It still asks me to give them access to the original document. I can set access on the original to view only and limit the time to one day.
Unsuccessful Clock In/Out: The new "copy" of the spreadsheet is not automatically linked with new "copy" of the Forms so it does not update when a new response is added. I must link it in form. This becomes more of an issue with my sheets that have formulas based on these responses. It is now necessary for each new user to manually link and rename the sheets to make them function correctly.
Clock In/Out System (attendance purposes)
Clock In Form
Clock Out Form
MSA Sheet
Attendance Office Sheet
Migrant Service Log (team communication purposes)
Migrant Service Log Form
Migrant Service Log Sheet
I would like for them to all be user-friendly and easily shared while keeping everything confidential to the user.
if you want to keep your formulas as a secret you can set up the 2nd spreadsheet and use IMPORTRANGE formula to get data over and then just simply link the 2nd spreadsheet somewhere on the end of the form.

Google Sheets: Keeping static data aligned with data returned from a query as new data is added on top

first time poster but I've been able to solve a lot of problems with through the brilliant answers this community provides to users. So, firstly, thanks!
I'm making a Job Request tracking spreadsheet as well as using a Google Form to get the input data.
Jobs fall under categories of Building, IT, Keys, Maintenance and OHS as asked in the first question of the Google Form.
Depending on which category is selected, the user will go to a different section of a form with different questions.
That's all working great.
The data for all responses is saved in the same form response sheet and then using the Query function I have 5 sheets set up, one for each category, and I'm reading the relevant data into each sheet. The data is sorted based on date and time so that the most recent entry is at the top of the sheet.
To the right of each data set on each individual sheet I want to track whether the job is Completed, Pending, Not Approved. I want to track who gave it approval, and so on.
The problem is that when new data comes into the sheet it moves to the top as it is the most recent data. But the Completed, Pending, Not Approved, and other notes will not move down the sheet with the older data.
Help would be greatly appreciated.
Thanks!

Can I make a summary of only selected data?

I want to select only certain rows and columns and use the same "summary of responses" feature but for limited data rather than all of it. Is this possible?
The report is with ALL DATA from this sheet - I want the exact same output but with only certain email addresses.
Google Form: bit.ly/bilvalchal_results
If I have a google spreadsheet can I make a summary of only selected data?
Yes, but I think your Title may be misleading. I thought at first you wanted any summary but now believe you want the specific format provided by Form > Show summary of responses, and that is quite different.
Is this possible?
In essence, I think not. For example, in Excel it is easy enough to avoid charting data simply by hiding it. That seems not to work here. Even deleting data in the Form responses sheet does not change the Summary of responses.
This presumably because both the Form responses sheet and the Summary of responses are distinct views of server-side data. I doubt there is a means for a user to control the code that drives the Summary of responses, whose data is gathered from the individual form submissions (as is the data shown in the responses sheet). Submissions have spawned both the sheet and the Summary but the two are independent of one another.
On the other hand.
As mentioned by #zeroCoder, equivalent results might be obtained by a user though it would seem with a considerable effort. A script may be required to set the chart type to use for each question by question type (if to avoid an ad-hoc basis, Form by Form). Once the type appropriate to each column has been determined it would be a little tedious but not difficult to create the corresponding chart. Adjusting the formatting, scales etc to match that of Summary of responses would also be tedious but with a script would not need to be purpose-built for each Form individually.
That said, I hope I am crassly mistaken and that actually it is quite easy. I suspect however you would have heard by now were that so.
Another option is to use the Awesome Tables web app. It allows filtering of your data (and more). It is available as a gadget on Google Sites.
So this doesn't use the built in feature exactly but it does the trick.
Take your sheet with all the rows and figure out which columns you want to show.
Create a new sheet called preview or whatever.
in the top cell for each column reference the row from the responses sheet like this ={'Form Responses 1'!A:A}
Then hit File>Publish to web and chose to publish your Preview sheet only.
Get your shared link (shorten it if you must).
Post that url in your form only and presto.
You win!
You need to use pivot tables here are some tutorials on how to use them:
How to create a pivot table report
Summarize your data with pivot tables

Resources