Hi @emmanuel so far I have a messaging functionality.
I am having a small problem with this. How can I establish this condition.
If user A has already sent user B a message before, and now when user A wants to send a new message to user B again, instead of it creating a new conversation how do I go about adding this new message to the previous conversation if there is any.
I tried using the yes/no state, but that would trigger in general and not specific to the particular user.
All this is happening when user A is trying to contact user B in a listings page and not directly in the messaging section.
Thanks!
“Conversation” Database Table
Fields:
- Participants (List of Users)
- Messages (List of Messages)
“Message” Database Table
Fields:
- Sender (User)
- Recipients (List of Users)
- Message (text)
“User” Database Table
Fields:
- Conversations (List of Conversations)
When the first message is created between 2 or more users, the new Conversation will be attached to all of the participants through the “List of Conversations” field. That first message will be added to the Conversation’s List of Messages. Now when a user creates a new Message in this already existing Conversation, instead of creating a new Conversation, the Message will just be added to this Conversation’s List of Messages.
Thank you for your reply. So far what you have suggested I have done.
eg. when user A see’s a listing (in listings page) of user B. and User A sends a message from that listing’s page itself, a new conversation is created and then after that I have a separate messaging section where user B and user A can contact each other, just like a messenger. All of this I have been able to establish. Now again, when user A sends a message to user B from the listings page again and not from the messenger, a new conversation gets created which I am trying to avoid.
Instead of the message button, I want something like message again, if the message is still in the data base between the users. I think I would need to trigger something and set something, that if A has already sent a message to B and there is a data of that message, a new conversation should not be created.
This shouldn’t be too complicated. When User A sends a message to User B on User B’s listing page, you just set 2 workflows:
-
If User A’s list of Conversations contains User B, then just create a message.
-
if User A’s list of Conversations doesn’t contain User B, then create a new Conversation and a message.
Lmk if this makes sense. I’ve built the exact same scenario you’re presenting so I want to make sure you make it perfect.
Hi @dbevan
This condition sounds right but I am not able to execute it.
On the send message button, when I try to create the condition you mentioned, but I get an error message saying that “only when should be a yes/no”
Im trying to add, when current user’s conversation list contains parent group’s user … I should stop at that but it keeps prompting me more and more options.
I have been trying to do this for an hour since the time I saw your message!
Please send a screenshot of the way you set up your Conversation & Message database tables.
Sorry, I should have been more precise.
When current user’s Conversation List[filter: Participants contains Parent Group’s User]'s count is 0, create a new Conversation. If it’s NOT 0, the just create the message.
Sorry for the confusion.
Also, the Message Table should have a Sender (User) and a List of Recipients (List of Users).
Thanks alot it worked. I was trying to get this right for many days and I wasn’t able to move ahead. Thanks alot!
Great!!! Glad I could help. Hmu anytime if you have further questions about your app.
Sure!
This topic was automatically closed after 70 days. New replies are no longer allowed.