Javascript Formatting in Text control


I'm new to Retool and since formatting options are limited, I'd like to know how to format text in a text control.

I tried using the checkbox control but there is no read-only feature and there was no way to disable user changes whout greying-out the control.

What I want is: "Feature is ON" and "Feature is OFF".

What I get is "Feature is ".

Thsi works fine when[0].IsFeatureEnabled is not null, but it fails otherwise.

The problem appears to be == null is never triggered. How do I check for a null object in retool javascript?

Code in Value box:
Feature is {{ == null ? "OFF" : ([0].IsFeatureEnabled ? 'ON': 'OFF') }}

Hey @Francis!

Great question! Does this query run on page load? Is there a chance that == undefined which is triggering false for your ternary condition here? Would you mind sharing an example response from your query?

The issue was was null, so trying to access would throw a page error.