How to return default value for getCell

Hi, I have the following canvas expression that uses getCell against a data source but it may return null, i.e.the kql returns nothing. Is there a way I can make getCell to return a default value when that happens. Any help will be appreciated. Thanks a lot!

| getCell "burrow_maxlag"
| shape fill=if {gt 5000} then="#F9BB11" else="#9bc7a0"} border="#070707" borderWidth=0.5 maintainAspect=false "square"
| render

You can try COALESCE

or switch case example

Thanks for the help. I tried the following but when there's no data return from essql, it still goes to then="#F9BB11"

I am new to canvas function and suspect that my nested if must be missing some parentheses or something. Any idea? Thanks.

| shape fill={if {rowCount | lt 1} then="#9bc7a0"
else={if getCell "burrow_maxlag" | compare "gt" to=1} then="#F9BB11"
else="#9bc7a0"} border="#070707" borderWidth=0.5 maintainAspect=false "square"
| render

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.