# Expression binding issue for 2 conditions

**URL:** <https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033>\
**Category:** Ignition\
**Created:** [April 5, 2022, 8:07am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033 "2022-04-05T08:07:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [April 5, 2022, 8:07am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033/1 "2022-04-05T08:07:58Z")

</div>

Hi ,

I have 2 tags

tag 1 value = 220 (float)  
tag 2 = true (Boolean)

i have created a expression tag and data type as boolean

if tag 1\>0 and tag 2 == true i want to return true  
else return flase

how to write for this one

i have tired code like this but this not working

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c668867dd908cd3440a92c81bda9cd338deaa1d6.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2022, 8:20am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033/2 "2022-04-05T08:20:09Z")

</div>

Create a binding expression as shown below. Note that the expression language does not use `==` syntax and uses `&&` for the logical AND operator (and `&` for the bitwise AND operator). See [Expression Language and Syntax - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Expression+Language+and+Syntax#ExpressionLanguageandSyntax-Operators) for details.

```auto
({[default]TestTags/tag 1} = 220) && {[default]TestTags/tag 2}

```

Tip: please use `</>` code formatting button when posting code or for inline code enclose it between ` backticks.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [April 5, 2022, 8:32am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033/3 "2022-04-05T08:32:32Z")

</div>

> [@Transistor](#):
>
> `({[default]TestTags/tag 1} = 220) && {[default]TestTags/tag 2}`

`if({[MQTT Engine]Edge Nodes/Montreal/Line/Common/Production Data/Mixing n Forming/FormingBelt_Speed.value} > 0) && {[MQTT Engine]Edge Nodes/Montreal/Line/Common/Production Data/Mixing n Forming/Mixer_Running.value} !=0,1,0)`

I have tired like this.. still getting **error configuration error**

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2022, 8:41am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033/4 "2022-04-05T08:41:29Z")

</div>

If you hover over the error message you will get further details.

Expression language allows breaking code over several lines. You can use this to your advantage to make the code readable. When you do you will see the following:

```auto
if(
	{[MQTT Engine]Edge Nodes/M ... /FormingBelt_Speed.value} > 0) 
	&& 
	{[MQTT Engine]Edge Nodes/M.../Mixer_Running.value} !=0,
	1,
	0
)

```

Note that you have a closing `)` on line 2 with no opening `(`.

Is the `n` part of the actual tag or is it supposed to be a number?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [April 5, 2022, 8:48am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033/5 "2022-04-05T08:48:51Z")

</div>

Note that you have a closing `)` - this is the issue i have removed the bracket working now thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2022, 9:09am UTC](https://forum.inductiveautomation.com/t/expression-binding-issue-for-2-conditions/58033/6 "2022-04-05T09:09:42Z")

</div>

Good.  
You should simplify your expression into the format that I posted. It is much easier to read. This is all you need:

```auto
{[MQTT Engine]Edge Nodes/M ... /FormingBelt_Speed.value}
&& 
{[MQTT Engine]Edge Nodes/M.../Mixer_Running.value}

```

Boolean operations return true for non-zero values so you don’t need either of your `>` operators.

Don’t forget to mark the question as solved.
