Tech Tip: Querying boolean in collection is case sensitive
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: August 10, 2020
When querying a boolean value withing a collection, keep in mind that the boolean values must be lowercase in order for a proper query. Take the example below:
C_COLLECTION($col_c;$test1_c;$test2_c;$test3_c;$test4_c) $es:=ds.Table_1.all() $col_c:=$es.toCollection("") $test1_c:=$col_c.query("bool = false") // Works $test2_c:=$col_c.query("bool = true") // Works $test3_c:=$col_c.query("bool = False") // Does not work $test4_c:=$col_c.query("bool = True") // Does not work |
In summary, make sure to use lowercase boolean values in a collection-based query to achieve the correct results.