Hi @niklasjegg,
A split function will return an array. In your expression you are trying to retrieve the second item/part of that split array. However, the error suggests that the array has a range of 0,0. So, I guess it can't find your | character in one of the items and has no split result.
As an example I could reproduce this same error with the expression below. Hope that makes sense?
split('Lets split some text', '|')[1]
My suggestion would be to first check if the item actually contains a | character before you start using it for a split function. You can use indexof, equals and if functions for this.
Edit: forgot to add examples 😅
When | character is present
if(equals(indexOf('Lets split | some text', '|'), -1), 'Do Nothing', split('Lets split | some text', '|')[1])
When | character is not present
if(equals(indexOf('Lets split some text', '|'), -1), 'Do Nothing', split('Lets split some text', '|')[1])