Help with Only Run When

I have two selection fields that are driven by a queries (lets call them select1 and select2) and two other text inputs (text1 and text2). If a user chooses a specific option in select2 (say "XYZ"), I would like to automatically set the value of text1 to the selected value of select1 and clear the value from text2. If the user chooses any other option in select2, I would like to clear the values from both text1 and text2.

I get the concept for running a script to do this, but when I try to put a formula like {{select2.value}}==="XYZ" in the only run when field, I get an error that the field must be a boolean value (which this should evaluate to either true or false).

How can I get this to work?

Thanks in advance for you help and suggestions.

Should be
{{select2.value ==="XYZ"}}