Replace by condition node unexpected output

Hello,

See image for my issue. Node works once, but not second time.
In my case I’m trying to replace “TRUE” and “FALSE” string with boolean value.

Dynamo 3.5.0 in Revit 2026

Works the other way around? :thinking:

This might be a weird edge case or something i have no idea about in dynamo :smiley:

I reproduced this in 2024

I think what’s happening is that ReplaceByCondition sees the ‘true’ values and thinks that they are the result of the comparison does x = y. And then it goes yep and replaces the value, which is a bit dodgy.

It looks like this was covered in the below post:

Converting text to boolean - Lists-Logic - Dynamo

1 Like

Yup. This has to do with Dynamo using truthy/falsy comparisons for text.


You can easily work around this by combining both conditions so you don’t end up with true/false values while the comparison is happening.

2 Likes

Thanks Nick, that looks like a great solution, I will use that in future.

All this logic talk made me think of the famous scene from labyrinth hehe.

1 Like