is there invalid value for a dropdown?

32 views
Skip to first unread message

Sandra Patricia Perdigon Cortes

unread,
Nov 1, 2024, 11:11:28 AMNov 1
to Google Apps Script Community

Hello guys,

Anyone can tell me how to know if a cell or range have invalid values for a dropdown in AppScript?

I found this, but it only works for a range. For a single cell, function getvalues() is invalid, I got this error: TypeError: critval.getValues is not a function

const {range} = e;

const values = range.getDataValidation().getCriteriaValues()[0].getValues().flat();

if (!values.includes(e.value)) {

SpreadsheetApp.getUi().alert ("Invalid data");

}

Any idea or another suggestion?

Thanks a lot.


The information contained in this e-mail may be confidential. It has been sent for the sole use of the intended recipient(s). If the reader of this message is not an intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, distribution or copying of this communication, or any of its contents, is strictly prohibited. If you have received it by mistake please let us know by e-mail immediately and delete it from your system. Many thanks.

 

La información contenida en este mensaje puede ser confidencial. Ha sido enviada para el uso exclusivo del destinatario(s) previsto. Si el lector de este mensaje no fuera el destinatario previsto, por el presente queda Ud. notificado que cualquier lectura, uso, publicación, diseminación, distribución o copiado de esta comunicación o su contenido está estrictamente prohibido. En caso de que Ud. hubiera recibido este mensaje por error le agradeceremos notificarnos por e-mail inmediatamente y eliminarlo de su sistema. Muchas gracias.


Reply all
Reply to author
Forward
0 new messages