I am familiar with the Google Apps script DataValidation object. To get and set validation criteria. But how to tell programatically if a cell value is actually valid. So I can see the little red validation fail message in the spreadsheet but can the fact the cell is currently failing validation be picked up thru code?
I have tried to see if there is a cell property that tells you this but there is not. Also I looked for some sort of DataValidation "validate" method - i.e. test a value against validation rules, but nothing there either
Any ideas? Is this possible??
Specific answer to your question, there is no method within Google Apps Script that will return the validity of a Range
such as .isValid(). As you state, you could reverse engineer a programatic one using Range.getDataValidations()
and then parsing the results of that in order to validate again the values of a Range.getValues()
call.
It's a good suggestion. I've added a feature request to the issue tracker -> Add a Star to vote it up.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句