to protect only input rules in SpreadSheet - google-apps-script

I am developing a customized SpreadSheet in GAS and would like to set up a validation rule in GAS to protect the data type. This works when the user types the value, but when it is copied, it does not work because it is overwritten by the validation rule from which it was copied. Is there a better way to do this?

Related

Sharing google sheet with restrictions

I've built my google sheet, and shared it with the team, the sheet has an entry point, where the user is entering some data, and balance data of the sheet is changing dynamically based on this input.
If 2 persons are using the sheet at the same time, the data will be changed based on the last guy who use this entry field, and the data the other guy seeing will be changed accordingly.
my sheet is here
The sheet is locked except the yellow shaded cell, which is allowed to be changed by the user.
Is there a way to allow each user to see the data based on his input parameter, without getting it destroyed when used by others!
I don't think what you're looking for is possible as Sheets is designed to be used for collaboration and edits will always be shown in real time. Consider adding multiple sheets and assign them to each of your team members with the exact formatting and formulas as the original so they can access and input their data independently.

How to ask a user for Sheets input, validate and process data?

Issue
Colleagues gather information on fairs and such and that information needs to be submitted. Currently they copy-paste this data in a Sheet and some data validations and such are applied on this sheet. However, data validation does not reject the input in case it's not an accepted value when you paste 2 or more values (it just gives a warning by marking the upper-right corner red). Furthermore, we are not able to set certain columns required.
Since this sheet is automatically imported in a database, it is important to have all required data present and with valid values.
Question
Would it be possible to have a Google Sites page that shows a Google Sheet, allows you to add data to this sheet and process this data when a submit button is clicked on the page?
Thoughts
I was able to find the Sheets integration in Google Sites, but the first issue I encounter is that users are not able to add data to this sheet through the Google Site.
I thought about doing this just in Sheets instead of a Google Sites solution, but this has some drawbacks:
Using a script would require user rights to edit the sheet that's automatically imported
Not very user friendly for simultaneous usage
Not an attractive interface
I'm not asking for a complete solution, but as I failed to find such a possibility I'd appreciate references to relevant documentation or opinions how this problem may be solved in the best way.

Email notification in google apps script

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.

How do I hide a single sheet, in google spreadsheets, using google-spreadsheet-api?

I wish to be able to hide certain sheets in my Google spreadsheet programmatically. So when a shared user logs into the spreadsheet, certain data ranges, sheets maybe hidden from their view. This way I can make all, some or no spreadsheet data visible according to the viewers email address.
I have no problem doing this with sheet protection using SpreadsheetApp classes and methods, and protecting certain sheets based on the viewers email address. But cant seem to find any classes or methods that support sheet hiding methods or properties
There is an open enhancement request for hiding/showing sheets; you might like to star it to be kept updated.

is there a way to access the validation rules for a spreadsheet range in google-apps-script

I have looked at the documentation for Spreadsheet class, Sheet class, and Range class.
I can not find a method that would give access to a range's validation rule(s).
And I looked in the documentation "using validation rules".
Is it possible to access the attribute(s), for each cell in a range?
I also assume that each cell in a range can only have one validation rule.
Am I wrong in this assumption?
I arrived at this assumption, because a cell appears to only display a single validation message.
Apps Script doesn't currently provide a way to access validation rules. There is a feature request open that you can follow though: http://code.google.com/p/google-apps-script-issues/issues/detail?id=219.