I have set up a chat app whereby you can create chats with individual users and also create group chats. I have set it up so that when i search for a user and select that user it creates a new chat if one doesn’t already exist. The problem i have is if the current user is in a group chat with the user they are trying to create an individual chat with then it won’t let me create a new chat. Do i need a condition adding to ignore this rule? if so what do i need. Below is how my data is set up and the workflows to create a new chat:
WHen i click the user i want to create the chat with i have 2 workflows as shown below depending if there is already a chat created.
1st if there is a chat already i have this workflow
The above workflow seems to be stopping me creating a new chat with an individual if theyare in a group chat together.
Below is the workflow that was working before i created the group chat function to add a new chat with the individual:
I am assuming that the chat is the same as the group chat with the difference being on the number of Chat-users with chat having 2 chat-user and group chat 3 or more chat-users. If that is the case, add an advanced filter in your ‘only when’ conditional using this fact.
Something like Advanced: This chat's Chat-Users' count: <= 2
If it is possible for a chat group to have 2 chat-users, then consider adding another data field the chat data type to differentiate between a chat and a group chat. For example something like ‘is-a-group-chat’ set to yes/no. Add any field that will differentiate the two and then add a constraint based on the new field. The above filter assumed group chats have 3 or more chat-users