# Ignition 8.1 Perspective Expressions (or script) Syntax

**URL:** <https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 14, 2022, 9:59pm UTC](https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082 "2022-09-14T21:59:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Data](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/data/32/4011_2.png) [@Data](https://forum.inductiveautomation.com/u/Data)\
**Post date:** [September 14, 2022, 9:59pm UTC](https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082/1 "2022-09-14T21:59:14Z")

</div>

Hello Everyone,  
I was searching for the correct systax in the help files and could not locate any "IF, Then, Else " syntax. I would appreciate any tips to point me in the right direction…  
My desired Script or Expression Task: Bind a single boolean check box object to 4 separate boolean tags so the operator checks one box and toggles enabled or disabled on four related alarm enables. Thank you in advance…

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [September 14, 2022, 10:23pm UTC](https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082/2 "2022-09-14T22:23:34Z")

</div>

You’re better served with a Change Script:

```auto
if currentValue is not None:
    # modify these tag paths to target the enabled status of your alarms
    tagPaths = ["tagPathOne", "tagPathTwo", "tagPathThree", "tagPathFour"]
    values = [currentValue.value for tag in tagPaths]
    system.tag.writeBlocking(tagPaths, values)

```

---

<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:** [September 14, 2022, 10:24pm UTC](https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082/3 "2022-09-14T22:24:27Z")

</div>

An alternative without scripting:

- Create a new memory tag, boolean, “Alarm Enable” (for example).
- Bind your checkbox to that tag and make it bidirectional.
- On each of the alarms
  - Hit the configure pencil icon
  - On the _Enabled_ option hit the link icon and select \*Tag | Alarm Enable".

That should be it. No need for ifs or buts.  
It might be worth noting that if there are multiple users using clients simultaneously then one will affect all the others since the tag is on the gateway.

Try this to set all tags in one go: Ctrl-click select each of the tags to be edited. Right-click and select _Edit tag(s)_.

* * *

The expression language if syntax is very like Excel’s IF function.  
`if(condition, "what to return if true", "what to return if false)`  
but you don’t need it in this case.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 15, 2022, 10:08am UTC](https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082/4 "2022-09-15T10:08:28Z")

</div>

I agree with @Transistor. An on change script will work, but it will be more cumbersome to implement and will be de-centralised. Using a memory tag and binding it to the 4 alarms’ alarm enabled property will ensure the enableds reflect the state of the memory tag. The memory tag can then be used in multiple places if required

---

<div class="post-metadata">

**Author:** ![Data](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/data/32/4011_2.png) [@Data](https://forum.inductiveautomation.com/u/Data)\
**Post date:** [September 15, 2022, 7:28pm UTC](https://forum.inductiveautomation.com/t/ignition-8-1-perspective-expressions-or-script-syntax/64082/5 "2022-09-15T19:28:14Z")

</div>

Thank you
