Workflow realisation

I want to implement a workflow so that when @username is mentioned, a notification is sent to the user with that username. I’m using the built-in ‘send notification’ function. How can I get this user by username in the workflow?

I shared in January, a workflow that parse the content of a comment to retrieve all mentioned users :

Feel free to import this workflow into Corteza and adapt it to your needs.

Here is the gist of out it work :

  1. I start by splitting the comment content by the space character (split(record.values.content, " ")). This will produce an array of string.
  2. For each string, I check if the string is equal to “data-type="mention"”.
  3. If it’s equal, your mentionned user ID is contained in the next array value
  4. It still need to be cleaned up a bit, I do it using trimLeft() and trimRight() like so : trimLeft(trimRight(commentContentArray[index], “"”), “data-id="”)

It might not be the most performant but it works for us.

2 Likes