Conditions cannot equal True/False as strings

This is on the latest version of Wappler. The only mention I can find of something similar is here: Please help me with my Conditional Server Action

If you enter a condition where you are checking for the text result “true” or “false”, it won’t place the text within ’ '. If you attempt to add them manually, they’ll be automatically removed. The only way I’ve found to fix this is to manually place them within the json, which doesn’t appear to cause any issues and works correctly, but that’s pretty inconvenient.
image

As opposed to any other text:
image

I’m not sure if this is intentional, but if it is, can it please be made so it doesn’t automatically remove the ’ ’ when entering them manually?

Hi @Digo,

Please try to go in Code view and enclose your condition in parenthesis.

That doesn’t stick for me either, I tried that prior to creating this thread – It’ll always remove them on my end.

Just tried with the latest Wappler and it all behaves as expected, you can pick or right boolbar==true in both design or code view it doesn’t matter

In my case it outputs the value yes! as expected:

Do note that true and false values doesn’t need any quotes or additional spaces

He wants ‘true’ to be a string for text comparison, not boolean comparison

Well we can’t really see the difference between a string quoted true or regular true and usually people want to enter the true as is and not as string so that is why we auto convert it.

Maybe you can use other value than a string true to check.

This isn’t possible for this project. The database gets 7+ million entries daily from external software, which cannot be easily changed. Could it not be an option within Wapplers settings to not automatically remove apostrophes if manually entered the code section?

I believe the simplest workaround here is smth like boolvar+'s'=='trues'

Only workaround I have found for this is to manually type the condition in the condition input field:
{{exec == 'true'}}
Don’t use the picker, just type it in, and you can see the correct expression in the UI.

I had a similar use case couple of weeks ago, but have forgotten why it was incorrect on Wappler’s end to remove the single quotes. Wanted to post here, but couldn’t find time, and now I don’t remember. :sweat:

1 Like