I have a calculated column which I have set to check if another column is blank or not.
I have a webservice which looks into this list and should return true or false if the column is empty or not. To simplify my code I have chosen to use the calculated column to easier determine the existence of data in the column.
However I've only found examples on how to return text, number, or dates when using a calculated field but not boolean.
I tried using bits (0 and 1), but when I try returning the calculated column as a boolean with either 0 or 1 I get the error "Specified cast is not valid".
[WebMethod]
public bool IsItTrue()
{
try {
// List query code blah blah
return (bool)listItem[CalculatedColumn];
}
catch (Exception ex) {
// Logging logic
}
}
So how do I make my calculated column contain boolean values?