Fixed
Status Update
Comments
da...@gmail.com <da...@gmail.com> #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).
dn...@google.com <dn...@google.com>
dn...@google.com <dn...@google.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?
dn...@google.com <dn...@google.com> #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.
lb...@gmail.com <lb...@gmail.com> #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()!!
mi...@gmail.com <mi...@gmail.com> #6
This is a blocking feature for implementing a compliance changelog of only valid entries.
mi...@gmail.com <mi...@gmail.com> #7
Would definitely be useful.
lb...@gmail.com <lb...@gmail.com> #8
Can't see why this isn't already available. I hope it is added soon!
mi...@gmail.com <mi...@gmail.com> #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!
a....@wavelinemedia.com <a....@wavelinemedia.com> #10
I'm desperate for this method to be added! Please please please do it soonest possible! Thank you!
l2...@gmail.com <l2...@gmail.com> #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.
da...@gmail.com <da...@gmail.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.
sl...@gmail.com <sl...@gmail.com> #13
Please add this in asimple manner: isValid() true or false
pi...@gmail.com <pi...@gmail.com> #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 ...
ni...@gmail.com <ni...@gmail.com> #15
I need it like a thirsty desert traveler needs a few drops of water.
ai...@gmail.com <ai...@gmail.com> #16
I need it like a few drops of water need hydrogen and oxygen
mi...@gmail.com <mi...@gmail.com> #17
Must I beg?
bb...@gmail.com <bb...@gmail.com> #18
Seems that begging is necessary...
ca...@gmail.com <ca...@gmail.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.
qu...@gmail.com <qu...@gmail.com> #20
OK Google... We know you can do it !
fr...@gmail.com <fr...@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
fr...@gmail.com <fr...@gmail.com> #22
+1
gr...@gmail.com <gr...@gmail.com> #23
It would be very cool
ra...@gmail.com <ra...@gmail.com> #24
+1
mu...@gmail.com <mu...@gmail.com> #25
+1
lb...@gmail.com <lb...@gmail.com> #26
+1
mu...@gmail.com <mu...@gmail.com> #27
+1
lb...@gmail.com <lb...@gmail.com> #28
+1
lb...@gmail.com <lb...@gmail.com> #29
+1
ma...@gmail.com <ma...@gmail.com> #30
+1
lb...@gmail.com <lb...@gmail.com> #31
+1
ga...@gmail.com <ga...@gmail.com> #32
+1
ki...@gmail.com <ki...@gmail.com> #33
+1
[Deleted User] <[Deleted User]> #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.
lb...@gmail.com <lb...@gmail.com> #35
+1 Hoping...
al...@gmail.com <al...@gmail.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
ko...@gmail.com <ko...@gmail.com> #37
+1
fr...@gmail.com <fr...@gmail.com> #38
Please add this
si...@gmail.com <si...@gmail.com> #39
+1
ra...@gmail.com <ra...@gmail.com> #40
+1
jj...@monetplus.cz <jj...@monetplus.cz> #41
+1
lb...@gmail.com <lb...@gmail.com> #42
+1
si...@gmail.com <si...@gmail.com> #43
+1
yu...@gmail.com <yu...@gmail.com> #44
+1
ra...@gmail.com <ra...@gmail.com> #45
+1
ps...@gmail.com <ps...@gmail.com> #46
+1
wo...@gmail.com <wo...@gmail.com> #47
+1
in...@gmail.com <in...@gmail.com> #48
+1
me...@gmail.com <me...@gmail.com> #49
+1
ed...@gmail.com <ed...@gmail.com> #50
+1
ja...@gmail.com <ja...@gmail.com> #51
+1
mo...@gmail.com <mo...@gmail.com> #52
Is somebody working on this one?
ms...@vivino.com <ms...@vivino.com> #53
I'm an experienced app developer and just starting w/ Appscript to customize my client's google sheets. I realized that this simple but critical function-- check if a cell value satisfies a data validation, or if satisfies the conditional formatting condition-- is missing!! Really surprised and disappointed. Tried to find a work-around but apparently I couldn't use some very useful built-in functions such as ISEMAIL within appscript. Lack of these features are quite discouraging to diving into Google Workspace Dev seriously. HOPEFULLY this feature will be RELEASE SOON!
mk...@gmail.com <mk...@gmail.com> #54
+1 for sure!
lb...@gmail.com <lb...@gmail.com> #55
@co...@geeksconnect.com
" HOPEFULLY this feature will be RELEASE SOON!"
Been asked since 2016 with no significant progress.
I think there´s more chance of google redoing their whole platform services (which they do frequently) at this point that getting some of these basic stuff.
Would not hold my code waiting for it.
Best worst solution might be to write your validation as a conditional to a temporary (or permanent) cell and read the value of the result I guess...
Haven´t used this in a while just because it´s not practical.
" HOPEFULLY this feature will be RELEASE SOON!"
Been asked since 2016 with no significant progress.
I think there´s more chance of google redoing their whole platform services (which they do frequently) at this point that getting some of these basic stuff.
Would not hold my code waiting for it.
Best worst solution might be to write your validation as a conditional to a temporary (or permanent) cell and read the value of the result I guess...
Haven´t used this in a while just because it´s not practical.
mk...@gmail.com <mk...@gmail.com> #56
+1
sn...@gmail.com <sn...@gmail.com> #57
+1 & holding my breath.
sn...@gmail.com <sn...@gmail.com> #58
+1
bl...@moshikids.com <bl...@moshikids.com> #59
+!
fr...@q42.nl <fr...@q42.nl> #60
+1
sn...@gmail.com <sn...@gmail.com> #61
+1 as well!!
lb...@gmail.com <lb...@gmail.com> #62
+1
ms...@vivino.com <ms...@vivino.com> #63
+1
to...@gmail.com <to...@gmail.com> #64
+1
lb...@gmail.com <lb...@gmail.com> #65
+1
wo...@gmail.com <wo...@gmail.com> #66
+1
ps...@gmail.com <ps...@gmail.com> #67
+1
an...@gmail.com <an...@gmail.com> #68
+1
sl...@gmail.com <sl...@gmail.com> #69
+1
[Deleted User] <[Deleted User]> #70
+1
lb...@gmail.com <lb...@gmail.com> #71
+1
te...@gmail.com <te...@gmail.com> #72
+1
lb...@gmail.com <lb...@gmail.com> #73
ia...@gmail.com <ia...@gmail.com> #74
+1
lb...@gmail.com <lb...@gmail.com> #75
+1
ni...@gmail.com <ni...@gmail.com> #76
+1
th...@gmail.com <th...@gmail.com> #77
+1. Add isValid() method
Description
void setRequestedOrientation(int requestedOrientation) {
+ if (ActivityInfo.isFixedOrientation(requestedOrientation) && !fullscreen
+ && appInfo.targetSdkVersion >= O) {
+ throw new IllegalStateException("Only fullscreen activities can request orientation");
+ }
I don't get why this restriction is needed. It's up to the app developers to decide when to set their own app in landscape or portrait modes, and it doesn't even matter if it's full screen or not.
And, to me, it seems Google should remove it because even Google developers got themselves a crash because of it, on Admob:
That's right. Using Admob when targeting Android 8.1 will crash the app, when showing an interstitial ad.
Imagine what would happen if we use a different ad network, that does the same...
Please remove this useless restriction.