How to create a reusable expression that takes 2 parameters?

I want to create a reusable expression that takes 2 parameters

ri!Errors (array of text)
ri!Error (text)

I want the xpression to check if the ri!Error already exists in the ri!Errors array. If it is already in the aray i want to return the original array. If it is not already in the array i want to add it and return the new array which will now include the new error.

Please look at the screenshot attached


OriginalPostID-222415

OriginalPostID-222415

  Discussion posts and replies are publicly visible