WhereClause using Bool value

Hi there,
Im trying to query a table based off a Boolean value, but cant seem to get it right…
This is my class…


class ContextualType : NSObject {
 var title: String?
 var topic: Topic?
 var id: Int = 0
 var apiKey: String?
 var source: String?
 var active: Bool = false
}

and this is my code…

func getAllActiveContextTypes(completionHandler: (success: Bool, data: AnyObject?) -> ()) {
 let dataQuery = BackendlessDataQuery()
 let whereClause = "active = true"
 dataQuery.whereClause = whereClause
 
 backendless.data.of(ContextualType.ofClass()).find(dataQuery, response: { (result: BackendlessCollection!) -> Void in
 
 var contextualTypeList = [ContextualType]()
 
 if result.getCurrentPage().count > 0 {
 let contextTypeResults = result.getCurrentPage()
 print("*** Found \(contextTypeResults.count) ContextualType objects")
 
 for contextType in contextTypeResults {
 let contextTypeObject = contextType as! ContextualType
 contextualTypeList.append(contextTypeObject)
 }
 } else {
 print("No Active ContextualType objects found in database..")
 
 }
 
 completionHandler(success: true, data: contextualTypeList)
 
 },error: { (fault: Fault!) -> Void in
 print("Server reported an error: \(fault)")
 completionHandler(success: false, data: nil)
 })
 }

I keep on getting no results, even though I have a Boolean column in my table called ‘active’ with at least one item with a ‘True’ value.

Am I using the Boolean where clause wrong? Docs dont seem to give any examples. Thanks!

never mind. I noticed that when I manually updated the Boolean values on my table, using the dropdown selector, changing the values dont trigger a save to the object. So all my objects still had ‘null’ values.

had to change another field which i could ‘enter’ so it triggered the save

When changing a boolean value, make sure to click the icon at the end of the row to save the value. I know it is not very intuitive, we’ll improve that.