# Reading Custom Property Values In Expression - Noob

**URL:** <https://forum.inductiveautomation.com/t/reading-custom-property-values-in-expression-noob/6470>\
**Category:** Ignition\
**Created:** [May 14, 2013, 4:26pm UTC](https://forum.inductiveautomation.com/t/reading-custom-property-values-in-expression-noob/6470 "2013-05-14T16:26:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![momoore](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@momoore](https://forum.inductiveautomation.com/u/momoore)\
**Post date:** [May 14, 2013, 4:26pm UTC](https://forum.inductiveautomation.com/t/reading-custom-property-values-in-expression-noob/6470/1 "2013-05-14T16:26:16Z")

</div>

I apologize for the total noob question here but searching for an example for the past 2 hours pushed me to post…

I have several custom properties I created a for rectangle on a template. I just want to compare a value of one of the string custom properties so I can set an integer based custom property based on the strings value.

I believe my issue is that I am not reading the string value properly but my lacking syntax knowledge is crippling me…

`
if ({Mach_1040.Container.Port1.Monitor} = "YES",
   {Mach_1040.Container.Port1.Port_Status} = 0,
   {Mach_1040.Container.Port1.Port_Status} = 3)`  
Expression editor accepts this but I don’t get the desired changes in the Port\_Status property. I believe I am not truly reading the string custom property Port1.Monitor value so it never evaluates the condition. Equally I doubt I am setting the integer custom property value of Port\_Status properly…

Any pointers would be greatly appreciated…

---

<div class="post-metadata">

**Author:** ![CPowell](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@CPowell](https://forum.inductiveautomation.com/u/CPowell)\
**Post date:** [May 14, 2013, 5:04pm UTC](https://forum.inductiveautomation.com/t/reading-custom-property-values-in-expression-noob/6470/2 "2013-05-14T17:04:22Z")

</div>

Put your expression on the Binding Properties of the Port\_Status.

Code would look like:

```auto
if({Root Container.Container.Monitor} = 'YES',0,3)
```

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![momoore](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@momoore](https://forum.inductiveautomation.com/u/momoore)\
**Post date:** [May 14, 2013, 5:10pm UTC](https://forum.inductiveautomation.com/t/reading-custom-property-values-in-expression-noob/6470/3 "2013-05-14T17:10:09Z")

</div>

yep yep… over thinking it again… code below works great… thanks! 😃

```auto
if ({Mach_1040.Container.Port1.Monitor} = 'YES', 0, 3)
```
