# Switch Notification block

**URL:** <https://forum.inductiveautomation.com/t/switch-notification-block/30149>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [November 21, 2019, 4:53pm UTC](https://forum.inductiveautomation.com/t/switch-notification-block/30149 "2019-11-21T16:53:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cole.sharrah](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@cole.sharrah](https://forum.inductiveautomation.com/u/cole.sharrah)\
**Post date:** [November 21, 2019, 4:53pm UTC](https://forum.inductiveautomation.com/t/switch-notification-block/30149/1 "2019-11-21T16:53:41Z")

</div>

Goal: Switch alarms on and off by site without making a separate pipeline on each individual alarm, all alarms are already setup to go out one pipeline.  
Idea: Use pipeline components to “filter” and separate.

{displayPath} property is set on all alarm - so I am trying to use that, shown below  
Example: Alarm’s tag/display path –  
" GasWellSites/Apollo/Wells/3M/GasFlowMeter/HiHi\_alm "  
" GasWellSites/Midas/Wells/3M/GasFlowMeter/HiHi\_alm "  
" GasWellSites/Zeus/Wells/3M/GasFlowMeter/HiHi\_alm "

Trying to use the Switch and split apart the tag path and check against the second part (Apollo) which is the site name.

Once split I and exits the switch correctly; it will then jump to another pipeline that is setup for each site and switch on/off, enabled/disabled by a toggle on screen. (I can do this last part)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0fa996183195ee7d4b17dc634ce1e5e96f2d0647.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 21, 2019, 5:12pm UTC](https://forum.inductiveautomation.com/t/switch-notification-block/30149/2 "2019-11-21T17:12:20Z")

</div>

The switch block uses expressions, which can’t do variable assignment like it appears you’re attempting. Try something like:

```auto
try(
    split({displayPath}, "/")[1, "parts"],
	"N/A"
)

```

---

<div class="post-metadata">

**Author:** ![cole.sharrah](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@cole.sharrah](https://forum.inductiveautomation.com/u/cole.sharrah)\
**Post date:** [November 21, 2019, 6:34pm UTC](https://forum.inductiveautomation.com/t/switch-notification-block/30149/3 "2019-11-21T18:34:29Z")

</div>

I tried it just like that, but I changed the “N/A” the Apollo name and made the value “Apollo” . The failover is executing and it is not pulling the Apollo name out.  
If I run this, the alarm gets sent out.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5612c91b0107c7c6381f32c4a0042d174913792c.png)  
If I run this, the alarm does not go out.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/06af40fc888e6e5a4844484023c36bda5477e9e4.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/61694e6286461cdec1433a8d45c977374362fa89.png)
