Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jun 10, 2021 05:25 PM
How do I test for an empty Message field when it’s a “Long text” type?
This code does not work…
let strReplyStatus = '';
if (rsReply.getCellValue('Message') === '') {
strReplyStatus = 'Empty';
};
if (rsReply.getCellValue('Message') == '') {
strReplyStatus = 'Empty';
};
Solved! Go to Solution.
Jun 10, 2021 06:47 PM
This code works…
if (rsReply.getCellValue('Message') === null) {
strReplyStatus = 'Empty';
};
Jun 10, 2021 06:47 PM
This code works…
if (rsReply.getCellValue('Message') === null) {
strReplyStatus = 'Empty';
};
Jun 13, 2021 07:41 AM
Alternatively:
if(rs.Reply.getCellValue('Message').length===0){
//do whatever
}
Or, if you want to get cute:
if(!rs.Reply.getCellValueAsString('Message').length>0){
//do whatever
}
Checking for null values is a pretty yolo thing to do in JavaScript AFAIK, and just going for the length check is usually better in terms of performance.