Forum Academy Marketplace Showcase Pricing Features

Workflow issue with creating a messaging system

i set up a workflow so that when a current user sends another user a message, a message is created, and a messaging thread between the two users is created. the user has a messaging inbox, which is a repeating group that displays all of the messaging threads that the current user is either the creator or receiver of the messaging thread (and the messages inside each messaging thred).

the problem is that this creates a new messaging thread each time. so yeah a message is created and added to the messaging thread, as i want it to, but a new message thread is created so it is just multiples of the same messaging thread, only with the repeating group displaying the latest message.

i am trying to make sure that the messaging thread is only created once, and so that the message inbox repeating group displays the message thread with the newest message, just like an inbox or sms.

how do i keep the user from creating a new messaging thread each time?

anyone have an idea for this?

There are a few different ways to do this, but one way would be to create conditional workflows for the send message button. For example:

When a thread already exists (DoASearchForThreads containing both Users:count is not 0): the send message workflow would only would create a new message (with its Thread field being the thread which displays the repeating group), and add that new message to the thread’s list of messages.

When a thread doesn’t already exist (DoASearchForThreads containing both Users:count is 0), the send message workflow would create a new thread, create a new message, and add that new message to the thread’s list of messages.

There are a few posts throughout the forum which discuss messaging more in-depth. Airdev has a useful example messenger app here as well :slight_smile:

1 Like

Well, I can’t understand the concept of a message thread. May you please explain what a message thread is?

A Message Thread is like a Conversation. :slight_smile: For example, on Facebook - if I were to message you, that would start a Message Thread between my account and your account. Every message sent would be ‘connected’ to this thread by either storing it on the Message itself, by keeping a list of Messages within the Message Thread, or both. Many different wants to set this up.

The Message Thread contains all of the messages that I send to you, and that you send back to me. If you were to have a conversation with a second User, that would start a second Message Thread. If you were to have a conversation with a third User, that would start a third Message Thread, etc. We wouldn’t want a new Message Thread created every time a Message from me to you or you to me is sent - only one. Then messages sent between us would be added to the Message Thread (or Conversation) that was already created/started.

1 Like

Okay. So basically a message thread is like a folder where files(in this case messages) are stored for two users. Make sense. Thanks a lot:grinning:

1 Like

thank you for your help, i was able to sort it out finally.

1 Like

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