Use a Label to display a boolean tag on or off in prospective

Looking for a way to use a Boolean tag and have it display on or off and replace the true or false text.

You should be using a Label component in this case.

Please edit your question and tag it as Vision or Perspective. The answer will depend on that. Also change the category from "General Discussion" to Ignition and select the version you're running.

Since your recent questions have been on Perspective then ...

You should use a Label component to display the status - not a Text Area or Text Field component.

  • Bind the label's text property to the boolean property to be displayed (using a Property binding).
  • Create a Map Transform on the result to convert True / False to On / Off.

Result:

On Off label

(Please do fix your question title.)

That worked thank you.

The prop binding/transform will work perfectly well, but an expression is supposedly more performant:

if({../ToggleSwitch.props.selected}, "On", "Off")
4 Likes