Group Messaging - Preventing Duplicates

My current app allows users to direct message each other. I have one-to-one messaging working, but having an issue with group chats. I have it set up where each Thread has a List of Users and a List of Messages.

Right now, when a user wants to create a chat (limited to one other person), I have a workflow that Searches for Threads with two filters: Users Contains Current User and User Contains Recipient. If a thread exists between these two people, rather than creating a new thread, it will just add a message to the thread that already exists.

While I know how to allow users to create group chats, I have not been able to figure out how to implement this same procedure to prevent duplicates. Basically, I would need to Search For Threads whose List of Users is exactly equal to this new chat’s List of Users. Does anyone know how to do this?

This topic was automatically closed after 70 days. New replies are no longer allowed.