# BUG?: Strange behaviour while comparing two strings in component event script

**URL:** <https://forum.inductiveautomation.com/t/bug-strange-behaviour-while-comparing-two-strings-in-component-event-script/89877>\
**Category:** Ignition\
**Tags:** scripting, vision, ignition81\
**Created:** [May 3, 2024, 8:35am UTC](https://forum.inductiveautomation.com/t/bug-strange-behaviour-while-comparing-two-strings-in-component-event-script/89877 "2024-05-03T08:35:42Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 3, 2024, 9:11am UTC](https://forum.inductiveautomation.com/t/bug-strange-behaviour-while-comparing-two-strings-in-component-event-script/89877/11 "2024-05-03T09:11:14Z")

</div>

I'm not sure but there are a few weirdnesses with assigning components content to variables in scripts.  
I've been burn by terribly counter-intuitive behavior, but I don't think it applies there.

Maybe someone else will have an answer for you...

here:

> [@\[IGN-1660\]PSA - Assigning values to a property in a script may drive you nuts](https://forum.inductiveautomation.com/t/ign-1660-psa-assigning-values-to-a-property-in-a-script-may-drive-you-nuts/76192):
>
> Hello folks, This got me pulling the hair out of my head. I spent the last hour yelling at my screen while doing all sorts of tests and experiments. I think I got it now, but... try it yourself. Here's the json for a perspective view: 
> 
> > ****
> >
> > { "custom": {}, "params": { "category\_id": "", "family\_id": "", "item\_id": "" }, "propConfig": { "custom.isFresh": { "access&q…

Edit:  
Actually it does apply there.  
If something changed the value in your input component...  
You'd expect the input to be a constant, but it's actually not.  
But there's no reason it would work with the `in` version...

---

_[View the full topic](https://forum.inductiveautomation.com/t/bug-strange-behaviour-while-comparing-two-strings-in-component-event-script/89877)._
