True/ false condition does not work

We received the following question from one of our clients and thought the answer might be useful for other members of the forum too:

I created a paragraph with a true/false condition. Depending on whether the condition is set to true or false, a different piece of text will be shown. My ClauseBase code is along the lines of this:

{#contract^fixed-duration = "true" : XXX | = "false": YYY}

However, the condition is not working. The condition always shows the text for when the condition is true. How do I fix this?

The problem is that you used quotation marks around true/false. If you remove those quotation marks, the condition will work. It will look like this:

{#contract^fixed-duration = true : XXX | = false: YYY}

This is so since quotation marks tell ClauseBase that the text in-between quotation marks is a piece of text. However, “true” and “false” in this context is not a piece of text, but rather it belongs to a true/false datafield.