Is it possible to use groupBy with step.events?
Pretty much title.
I have a workflow with a digest running, and I followed the docs for the count excluding individuals:
But in this case, this is for a one-time event. I am trying to notify messages received, like in a chat. So the same user can send many messages, that got digested and sent.
The problem in that snippet, in my situation, is that if I send 5 messages, I will receive the notification as
Person1 and 4 other sent a message
, but I was the one that sent the 5 messages.
I was thinking about using the groupBy title, but since I'm having the digest and doing a each step.events
, i got stuck.
Can someone help or know if this is possible?4 Replies
Hi @Obscene Burrito
groupBy can be used to group the array items in one group by propery
you can use array length for counting messages
https://docs.novu.co/content-creation-design/handlebars-helpers#using-array-length-as-count
Yeah, i know. My question is if it's possible to use groupBy with
#each step.events
.
As I mentioned before, this is what happens nowadays:
The problem in that snippet, in my situation, is that if I send 5 messages, I will receive the notification as Person1 and 4 other sent a message
, but I was the one that sent the 5 messages.
and i want to have the unique values in this case@Obscene Burrito could you share your payload ?
yes!
this is what i'm doing:
`
but i'd like to do something like: