# Split function syntax for alarm notification piplebock?

**URL:** <https://forum.inductiveautomation.com/t/split-function-syntax-for-alarm-notification-piplebock/68376>\
**Category:** Ignition\
**Created:** [January 9, 2023, 3:51pm UTC](https://forum.inductiveautomation.com/t/split-function-syntax-for-alarm-notification-piplebock/68376 "2023-01-09T15:51:39Z")\
**Posts on this page:** 4\
**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:** [January 9, 2023, 3:51pm UTC](https://forum.inductiveautomation.com/t/split-function-syntax-for-alarm-notification-piplebock/68376/1 "2023-01-09T15:51:39Z")

</div>

Hello guys. I have the following message in an alarm notification pipeblock however the split function does not seem to be working. i assume i have the wrong syntax. any inputs?

Alarm {name} transitioned to {eventState} at {eventTime|hh:mm:ss}. The display path is {displayPathOrSource}. The machine is {displayPathOrSource}.split('/')[7]

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 9, 2023, 4:01pm UTC](https://forum.inductiveautomation.com/t/split-function-syntax-for-alarm-notification-piplebock/68376/2 "2023-01-09T16:01:00Z")

</div>

This looks like you're mixing expression and script.

`.split()` is a python/jython method on strings.  
expressions do have an equivalent, also called split:  
[https://docs.inductiveautomation.com/display/DOC81/split](https://docs.inductiveautomation.com/display/DOC81/split)

---

<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:** [January 9, 2023, 4:18pm UTC](https://forum.inductiveautomation.com/t/split-function-syntax-for-alarm-notification-piplebock/68376/3 "2023-01-09T16:18:09Z")

</div>

ok. i changed it but its the same. But you can see in the image the split string function is still not working

Alarm {name} transitioned to {eventState} at {eventTime|hh:mm:ss}. The display path is {displayPathOrSource}. The spread is split(toString({displayPathOrSource}),"/")[7,0]

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f8e55ba5e18a84705932d00f187bbd6697b4972.png)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 9, 2023, 7:05pm UTC](https://forum.inductiveautomation.com/t/split-function-syntax-for-alarm-notification-piplebock/68376/4 "2023-01-09T19:05:10Z")

</div>

I think you actually can't use expressions in the notification block.  
Here's what I can suggest: Add a script block just before your notification block, with this code:

```python
event['pathOrSource'] = event['displayPathOrSource'].split('/')[7]

```

then use `{pathOrSource}` instead of `displayPathOrSource` in your message.
