to-bool

The to-bool operation turns a value into true or false.

Use it when the other side expects a real boolean rather than text, and when you want a clean yes or no to branch on later.

It changes the type, not just the look of the value. A JSON request then carries true rather than "true" or 1.

What comes out

The conversion recognises these values case-insensitively:

  • on, yes, 1, true → true
  • off, no, 0, false → false
  • boolean true and false stay unchanged
  • unrecognised values return null

So "1" becomes true, "0" becomes false, "YES" becomes true and "OFF" becomes false.

The catch

Only the recognised values above are converted. An unknown value such as "foo" or "bar" becomes null, not true or false.

"0" is the only non-empty string that becomes false. Everything else with a character in it is true.

That means a field filled in as "no", "off" or "nope" becomes true, which is the opposite of what it says. If your values are words rather than flags, do not use to-bool. Use set value with a condition for each value, so you decide what maps to what.

Watch the empty case too. A field nobody filled in becomes false, which reads as an explicit no rather than as a missing answer. When the difference matters, handle the empty case separately with do-not-send.

An empty list is false and a list holding a single zero is true, which surprises people the first time.

When you need it

Consents and checkboxes are the usual reason. A checkbox reaches Connection Creator as "1" or "0"; toBool() converts those to JSON true or false.

It is also worth doing before a condition that branches on the value, so you are comparing a real boolean rather than whatever text happened to arrive.

Settings

The operation takes no parameter. Set the source and the condition, choose to-bool, and there is nothing else to fill in.

Reference

Apart from the two words above, the conversion follows PHP’s rules for casting to boolean. See PHP: Converting to boolean.

Insights that
helps you grow

  • Release notes 2026/08/14
    This was a big one. We went through roughly 200 pages of our knowledge base and rewrote the whole thing. Clearer structure, consistent terminology, and…
  • Release notes 2026/07/31
    What’s new in PalDock? A lot of this month went into things you won’t see directly – query optimisation, indexing, and general tuning under the…
  • Free Affiliate tracking software
    Many companies (inlcuding YOU) search for free affiliate tracking software because they want to launch an affiliate program without committing to expensive monthly fees. The…