Infeasible
Status Update
Comments
zi...@iinet.net.au <zi...@iinet.net.au> #2
I'd also love to see this as a formula, in order to apply conditional formatting based on the whether the content of a cell passes the data validation rule or not. Something like ISVALID(value).
ba...@gmail.com <ba...@gmail.com> #3
I'm completely baffled: what's the point of "Data Validation" if there's no way of checking whether the data satisfies the condition? Could we all be missing something?
[Deleted User] <[Deleted User]> #4
@marc.art: The validation still validates within the UI itself; it's just that the results of the validation aren't available in code.
[Deleted User] <[Deleted User]> #5
This would be extremely helpful! Im looking to optimize my team's workflow and it is counterintuitive and wasteful on resources to reverse engineer the validation just to check if it is valid when that information is already shown in the UI! Please add .isValid()!!
w....@gmail.com <w....@gmail.com> #6
This is a blocking feature for implementing a compliance changelog of only valid entries.
dz...@gmail.com <dz...@gmail.com> #7
Would definitely be useful.
dz...@gmail.com <dz...@gmail.com> #8
Can't see why this isn't already available. I hope it is added soon!
go...@trinode.co.uk <go...@trinode.co.uk> #9
I've created a workaround for this issue that works in a very ugly -technically said- and slightly undetermined way.
My problem is that the validation is already done by the SpreadsheetApp, but only visually accessible by the user. It feels like that "you can see but cannot touch" :) It's against the whole idea of GAS.
I'd really love to have this result accessible (the feature implemented).
About the workaround:
It works based on the experience that the web browser implementation of catch() function allows to access thrown errors by the script editor JS code parts.
In case an invalid input into a cell is rejected by a validation rule then the system will display an error message that is catchable by the user written GAS. In order to make it work first the reject value has to be set on the specified cell then its vale has to be re-entered (modified) then -right after this- calling the getDataValidation() built in function allows us to catch the necessary error.
Only single cells can be tested with this method as setCellValues() ignores any data validation restriction (as of today).
Disadvantages:
- The validity won't be necessarily re-checked for this function: checking cell validity right after the value is inserted into it. Therefore the result of this function might be faulty.
- The code messes up the history as cells will be changed - in case they are valid.
I've tested it successfully on both Firefox and Chromium.
function getCellValidity(cell) {
var origValidRule = cell.getDataValidation();
if (origValidRule == null || ! (cell.getNumRows() == cell.getNumColumns() == 1)) {
return null;
}
var cell_value = cell.getValue();
if (cell_value === '') return true; // empty cell is always valid
var is_valid = true;
var cell_formula = cell.getFormula();
// Storing and checking if cell validation is set to allow invalid input with a warning or reject it
var reject_invalid = ! origValidRule.getAllowInvalid();
// If invalid value is allowed (just warning), then changing validation to reject it
// IMPORTANT: this will not throw an error!
if (! reject_invalid) {
var rejectValidRule = origValidRule.copy().setAllowInvalid(false).build();
cell.setDataValidation(rejectValidRule);
}
// Re-entering value or formula into the cell itself
var cell_formula = cell.getFormula();
if (cell_formula !== '') {
cell.setFormula(cell_formula);
} else {
cell.setValue(cell_value);
}
try {
var tempValidRule = cell.getDataValidation();
} catch(e) {
// Exception: The data that you entered in cell XY violates the data validation rules set on this cell.
// where XY is the A1 style address of the cell
is_valid = false;
}
// Restoring original rule
if (rejectValidRule != null) {
cell.setDataValidation(origValidRule.copy().setAllowInvalid(true).build());
}
return is_valid;
}
Finally let me express my gratitude for all the great works of the developers! With their shared tools/system I can solve many logistical problems of my and others' lives... Cheers!
On this issue: Hurry up guys!
My problem is that the validation is already done by the SpreadsheetApp, but only visually accessible by the user. It feels like that "you can see but cannot touch" :) It's against the whole idea of GAS.
I'd really love to have this result accessible (the feature implemented).
About the workaround:
It works based on the experience that the web browser implementation of catch() function allows to access thrown errors by the script editor JS code parts.
In case an invalid input into a cell is rejected by a validation rule then the system will display an error message that is catchable by the user written GAS. In order to make it work first the reject value has to be set on the specified cell then its vale has to be re-entered (modified) then -right after this- calling the getDataValidation() built in function allows us to catch the necessary error.
Only single cells can be tested with this method as setCellValues() ignores any data validation restriction (as of today).
Disadvantages:
- The validity won't be necessarily re-checked for this function: checking cell validity right after the value is inserted into it. Therefore the result of this function might be faulty.
- The code messes up the history as cells will be changed - in case they are valid.
I've tested it successfully on both Firefox and Chromium.
function getCellValidity(cell) {
var origValidRule = cell.getDataValidation();
if (origValidRule == null || ! (cell.getNumRows() == cell.getNumColumns() == 1)) {
return null;
}
var cell_value = cell.getValue();
if (cell_value === '') return true; // empty cell is always valid
var is_valid = true;
var cell_formula = cell.getFormula();
// Storing and checking if cell validation is set to allow invalid input with a warning or reject it
var reject_invalid = ! origValidRule.getAllowInvalid();
// If invalid value is allowed (just warning), then changing validation to reject it
// IMPORTANT: this will not throw an error!
if (! reject_invalid) {
var rejectValidRule = origValidRule.copy().setAllowInvalid(false).build();
cell.setDataValidation(rejectValidRule);
}
// Re-entering value or formula into the cell itself
var cell_formula = cell.getFormula();
if (cell_formula !== '') {
cell.setFormula(cell_formula);
} else {
cell.setValue(cell_value);
}
try {
var tempValidRule = cell.getDataValidation();
} catch(e) {
// Exception: The data that you entered in cell XY violates the data validation rules set on this cell.
// where XY is the A1 style address of the cell
is_valid = false;
}
// Restoring original rule
if (rejectValidRule != null) {
cell.setDataValidation(origValidRule.copy().setAllowInvalid(true).build());
}
return is_valid;
}
Finally let me express my gratitude for all the great works of the developers! With their shared tools/system I can solve many logistical problems of my and others' lives... Cheers!
On this issue: Hurry up guys!
[Deleted User] <[Deleted User]> #10
I'm desperate for this method to be added! Please please please do it soonest possible! Thank you!
[Deleted User] <[Deleted User]> #11
Yes please implement this. I suppose the data could be checked against the data validation rules before setting the values, but that would really slow the write process down. Not to mention how much of a pain it would be to code all the validity checks to accommodate all the different possible data validation rules.
I've been starting to use Google Sheets to serve some of our company's data storage in place of data typically stored in a SQL database, but the hard data validation rules are an essential part to maintaining data integrity in the way that's possible with a SQL database.
I've been starting to use Google Sheets to serve some of our company's data storage in place of data typically stored in a SQL database, but the hard data validation rules are an essential part to maintaining data integrity in the way that's possible with a SQL database.
tr...@gtempaccount.com <tr...@gtempaccount.com> #12
Please add this. It will bring down so much bad code that I have put in place due to lack of this function.
th...@gmail.com <th...@gmail.com> #13
Please add this in asimple manner: isValid() true or false
ni...@zxgen.net <ni...@zxgen.net> #14
I would say the methis should be intiutive to read.
Range.dataValidate() :: [][]bool
Since we are doing DataValidations ...
Range.dataValidate() :: [][]bool
Since we are doing DataValidations ...
zi...@iinet.net.au <zi...@iinet.net.au> #15
I need it like a thirsty desert traveler needs a few drops of water.
ni...@zxgen.net <ni...@zxgen.net> #16
I need it like a few drops of water need hydrogen and oxygen
[Deleted User] <[Deleted User]> #17
Must I beg?
[Deleted User] <[Deleted User]> #18
Seems that begging is necessary...
ha...@hallfleming.com <ha...@hallfleming.com> #19
Also require this, so i can track any validations fails centrally, without logging into each spreadsheet and sheet to check which is time consuming.
td...@gtempaccount.com <td...@gtempaccount.com> #20
OK Google... We know you can do it !
dg...@gmail.com <dg...@gmail.com> #21
Nearly 5 years later and still no change..
I don't think this will happen
I don't think this will happen
ni...@zxgen.net <ni...@zxgen.net> #22
+1
da...@davefink.com <da...@davefink.com> #23
It would be very cool
[Deleted User] <[Deleted User]> #24
+1
si...@gmail.com <si...@gmail.com> #25
+1
si...@gmail.com <si...@gmail.com> #26
+1
ma...@sambartle.co.uk <ma...@sambartle.co.uk> #27
+1
ct...@thepond.com <ct...@thepond.com> #28
+1
hy...@gmail.com <hy...@gmail.com> #29
+1
ka...@gmail.com <ka...@gmail.com> #30
+1
ha...@hallfleming.com <ha...@hallfleming.com> #31
+1
ro...@thegerrings.com <ro...@thegerrings.com> #32
+1
mi...@gmail.com <mi...@gmail.com> #33
+1
as...@chipnick.com <as...@chipnick.com> #34
+1 would be incredibly helpful to just have an ISVALID() formula that returns TRUE has a legit data validation value and FALSE if somebody entered a value into the cell that doesn't match a data validation value. Simple addition to Google Sheets that would make tons of people happy.
ma...@neimeyer.org <ma...@neimeyer.org> #35
+1 Hoping...
gr...@heier.com <gr...@heier.com> #36
This would be extremely helpful!
Strange that it is not yet implemented, or able to get error validation.
+1
Strange that it is not yet implemented, or able to get error validation.
+1
ga...@pitt-nash.com <ga...@pitt-nash.com> #37
+1
[Deleted User] <[Deleted User]> #38
Please add this
be...@capitollien.com <be...@capitollien.com> #39
+1
jm...@gmail.com <jm...@gmail.com> #40
+1
Description
------------
HTC Desire - Telstra (AU)
Firmware: 2.1-update1
Kernel version 2.6.29-3cb3dfbf
Build number: 1.16.841.1.CL171554 release-keys
Software number: 1.16.841.1
Bug Description
---------------
When a user has both a Google account, and a Google Apps account (ie the
users mail domain is hosted by Google) and the user registers his/her
Google Apps account on the phone (for access to email, calendar etc) the
Market will not allow the user to log in to Market with their standard
Google account. (Invalid password error is returned, even though the
correct password is entered)
Steps to Reproduce Defect
-------------------------
1) Create a Google Apps (Google Apps For Your Domain) account and create a
primary email address (eg user@example.com with password1)
2) Create a standard Google account and use the email address created in
step #1 above (eg user@example.com with password2) as the primary email
address. Set up Google Checkout on this account.
3) Factory reset Android phone
4) During initial setup wizard enter the Google Apps account (eg
user@example.com with password1)
5) Start the Market app, and try to log on with the standard Google account
(eg ser@example.com with password2)
==> Invalid password error
Correct Behaviour
-----------------
User should be prompted to choose if the account details they are entering
needs to be authenticated as a Google account or a Google Apps account.
(This may be better done at an OS level rather than specifically for the
Market app.
Impact
------
The impact to affected users is very high, as it means they cannot purchase
paid apps from the Android store.
This scenario is very common as every Google Apps user also needs a
secondary Google account to access any services such as YouTube, Picasa,
Google Checkout, iGoogle etc etc
This defect appears to affect every version of Android Market, and every
Android device so is very widespread.
The Android Market does not provide any other alternatives to purchasing
apps (ie there is no way to purchase from the PC using a web browser to
work around this issue)
Workaround
----------
As this is a common issue, a workaround has been identified:
This workaround has certain limitations:
1) The user has to change their primary email address on their Google
account
2) Changing the primary email address can cause other services which use
Google accounts for authentication to fail (eg the user will be locked out
of their AppBrain account)
Notes
-----
This defect appears to be because Android has no option to specifiy if an
account is a standard Google account or a Google Apps account
This bug is similar to #2322, but that is logged as a feature request
rather than a defect, and is not currently being worked on)
Once the user has logged onto the Market app with a valid account (eg
Google Apps) it is not possible to change accounts without doing a hard
reset of the device.