# Nested if statement in expression language

**URL:** <https://forum.inductiveautomation.com/t/nested-if-statement-in-expression-language/67108>\
**Category:** Ignition\
**Created:** [November 30, 2022, 8:08pm UTC](https://forum.inductiveautomation.com/t/nested-if-statement-in-expression-language/67108 "2022-11-30T20:08:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahman.tarek](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@rahman.tarek](https://forum.inductiveautomation.com/u/rahman.tarek)\
**Post date:** [November 30, 2022, 8:08pm UTC](https://forum.inductiveautomation.com/t/nested-if-statement-in-expression-language/67108/1 "2022-11-30T20:08:48Z")

</div>

Hi,

I have an expression binding and i want to return 1 if the conditions of 2 tags is how i want it. unfortunately im getting a syntax error. can someone help?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4a54c8920d488b391c2fb594443713d5f859895c.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 30, 2022, 8:16pm UTC](https://forum.inductiveautomation.com/t/nested-if-statement-in-expression-language/67108/2 "2022-11-30T20:16:23Z")

</div>

Make two custom properties that use indirect tag bindings to bring in the two tags you care about (avoiding the use of the `tag()` expression function, which can lead to scalability/performance problems over time).

Then your expression binding is just:  
`{myCustomProperty1} = "AUTOMATIC" && {myCustomProperty2} = "ACTIVE"`  
Or use `||` for a logical OR. You don't need the `if` function to return a true/false value; the boolean operator will automatically return a true/false.
