# Chat Functionality Help

**URL:** <https://forum.adalo.com/t/chat-functionality-help/22109>\
**Category:** Get Help\
**Created:** [January 16, 2022, 2:36pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109 "2022-01-16T14:36:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aryan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/aryan/32/15087_2.png) [@aryan](https://forum.adalo.com/u/aryan)\
**Post date:** [January 16, 2022, 2:36pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/1 "2022-01-16T14:36:10Z")

</div>

Hey, i’m creating an e-commerce app like amazon and wanted to add a feature to it:

How can I create a button on the product page that says “Contact Seller”  
When clicked it should **create a conversation** between **the buyer and the seller** where they can chat about the product and sell it.

In terms of database, relationships and click actions. How can this be made possible?

What i’m mainly stuck at: When I add a relationship with “User” and “Conversation”  
Should I do this twice to add “Seller” once and then “Buyer” the second time? (One to many)

Any help is appreciated. Thank you

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 16, 2022, 8:10pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/2 "2022-01-16T20:10:56Z")

</div>

Hi Aryan,

You can create a Many to Many relationship and add two Update actions to add the logged in user (buyer) and the seller.

Thank you

---

<div class="post-metadata">

**Author:** ![aryan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/aryan/32/15087_2.png) [@aryan](https://forum.adalo.com/u/aryan)\
**Post date:** [January 18, 2022, 1:11pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/4 "2022-01-18T13:11:30Z")

</div>

Thank you so much for the help!

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 18, 2022, 1:12pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/5 "2022-01-18T13:12:08Z")

</div>

Your Welcome!

---

<div class="post-metadata">

**Author:** ![silentdrummer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/silentdrummer/32/11561_2.png) [@silentdrummer](https://forum.adalo.com/u/silentdrummer)\
**Post date:** [January 18, 2022, 3:53pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/6 "2022-01-18T15:53:40Z")

</div>

I recently implemented a similar functionality. I thought about the many-to-many collections approach but somehow couldn’t make it work to properly manage an “unread” status and display Icons accordingly.

I ended up using two one-to-many fields for the two participants in the conversation and two unread fields for both participants.

Now that I think of it, I might give the many-to-many approach another try.

---

<div class="post-metadata">

**Author:** ![aryan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/aryan/32/15087_2.png) [@aryan](https://forum.adalo.com/u/aryan)\
**Post date:** [January 18, 2022, 5:05pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/7 "2022-01-18T17:05:39Z")

</div>

How did you manage to have an icon show for when messages are read and unread? That’s a feature that would be great for this!

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 18, 2022, 5:07pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/8 "2022-01-18T17:07:00Z")

</div>

Maybe this thread will helps you.

> [@Read status changes on ALL screens? Help!](https://forum.adalo.com/t/read-status-changes-on-all-screens-help/18546):
>
> I’ve already set up a perfectly functioning messaging system (with read status on/off linked if a user has opened a message or not). Now comes my final problem: I want the inbox icon (on many screens throughout app) to light-up when the user has an unread message in their inbox. I’m having a lot of trouble figuring this out and would appreciate any help! Thanks Ari

---

<div class="post-metadata">

**Author:** ![aryan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/aryan/32/15087_2.png) [@aryan](https://forum.adalo.com/u/aryan)\
**Post date:** [January 18, 2022, 5:13pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/9 "2022-01-18T17:13:06Z")

</div>

This is amazing and very helpful! You sure do know your way around Adalo and it’s great to see you helpout!

---

<div class="post-metadata">

**Author:** ![silentdrummer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/silentdrummer/32/11561_2.png) [@silentdrummer](https://forum.adalo.com/u/silentdrummer)\
**Post date:** [January 19, 2022, 4:17pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/10 "2022-01-19T16:17:29Z")

</div>

@Dilon is there also the possibility to notify multiple users at the same time in a group chat?

---

<div class="post-metadata">

**Author:** ![njimmy10](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/njimmy10/32/23489_2.png) [@njimmy10](https://forum.adalo.com/u/njimmy10)\
**Post date:** [January 19, 2022, 6:15pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/12 "2022-01-19T18:15:53Z")

</div>

Yeah

---

<div class="post-metadata">

**Author:** ![silentdrummer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/silentdrummer/32/11561_2.png) [@silentdrummer](https://forum.adalo.com/u/silentdrummer)\
**Post date:** [January 20, 2022, 9:16am UTC](https://forum.adalo.com/t/chat-functionality-help/22109/13 "2022-01-20T09:16:39Z")

</div>

@njimmy10 not very helpful! can you please explain?!

@Victor I’ve seen your great video on chat app enhancements. My problem is, that the unread and read status is only updated upon a refresh of the website and not immediately. The same goes for new messages, they are only displayed upon reloading the app.

Also: if the messages are sorted chronologically (latest message at the bottom), how can I tell the list component to scroll down to the bottom or start at the bottom (like whatsapp)?

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 20, 2022, 9:20am UTC](https://forum.adalo.com/t/chat-functionality-help/22109/14 "2022-01-20T09:20:15Z")

</div>

@silentdrummer The badge or a notification like trigger notifications?

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 20, 2022, 9:21am UTC](https://forum.adalo.com/t/chat-functionality-help/22109/15 "2022-01-20T09:21:47Z")

</div>

> [@silentdrummer](#):
>
> Also: if the messages are sorted chronologically (latest message at the bottom), how can I tell the list component to scroll down to the bottom or start at the bottom (like whatsapp)?

In that screen go to the Edit Styles and enable the Reverse Scrolling.

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [January 20, 2022, 9:36am UTC](https://forum.adalo.com/t/chat-functionality-help/22109/16 "2022-01-20T09:36:24Z")

</div>

Hi @silentdrummer,

You need to turn the list auto-refresh on (see “advanced” section of the list).  
As for the scroll to the bottom - Dilon has already answered, you need to turn the reverse scrolling on.

In general I’d avoid using Adalo for massive chats - there is a big chance this will become very slow when you have 100+ messages in a chat.

Best,  
Victor.

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [January 20, 2022, 9:37am UTC](https://forum.adalo.com/t/chat-functionality-help/22109/17 "2022-01-20T09:37:57Z")

</div>

And this will stop working when you have approx. 200+ users with 10-20 M2M relationships each. Adding a relationship will take several seconds then.

I would not recommend using many-to-many unless it is absolutely required and would try to use junction tables whenever possible.

Best,  
Victor.

---

<div class="post-metadata">

**Author:** ![silentdrummer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/silentdrummer/32/11561_2.png) [@silentdrummer](https://forum.adalo.com/u/silentdrummer)\
**Post date:** [January 20, 2022, 11:44am UTC](https://forum.adalo.com/t/chat-functionality-help/22109/18 "2022-01-20T11:44:18Z")

</div>

Thanks @Victor and @Dilon!

As for the Reverse Scrolling: this actually loads the normal way but then just scrolls down to the bottom, “bouncing” up and down several times when the end is reached. looks like a cheap workaround to me which probably doesn’t work along with “only load & display visible items” and will most likely result in poor performance in longer chats.

As for the Auto-Refresh: I have had auto-refresh turned on, and it does work quite well on the chat screen. I do, however, have a text component on the message overview where the last message of each chat is displayed, and this doesn’t get updated automatically when another user writes a message although I have auto-refresh on for both nested lists. I need to reload the app in order for the last message (and the unread status) to be updated.

@Victor, I’ll give your suggestion for the junction table a try as soon as I notice performance problems, but the chat probably won’t be too big anyways.

thanks a lot!

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 20, 2022, 12:05pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/19 "2022-01-20T12:05:41Z")

</div>

> [@silentdrummer](#):
>
> As for the Auto-Refresh: I have had auto-refresh turned on, and it does work quite well on the chat screen. I do, however, have a text component on the message overview where the last message of each chat is displayed, and this doesn’t get updated automatically when another user writes a message although I have auto-refresh on for both nested lists. I need to reload the app in order for the last message (and the unread status) to be updated.

For this there’s a component called Real Time Chat made by Pragmaflow.

> [@Build Real-Time Chat, for real](https://forum.adalo.com/t/build-real-time-chat-for-real/21624):
>
> Releasing a new component that facilitates real-time chat over websockets. We are still testing the ins and outs to make sure all is well, feel free to install it and give feedback. Also, if you use PragmaFlow components in your apps and you have issues, please contact us first before contacting Adalo Support! [[Adalo actual real-time chat (for real)] ](https://www.youtube.com/watch?v=azq89K6rELQ)[https://adalo.pragmaflowservers.com/install-component](https://adalo.pragmaflowservers.com/install-component)

Working very well.

---

<div class="post-metadata">

**Author:** ![silentdrummer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/silentdrummer/32/11561_2.png) [@silentdrummer](https://forum.adalo.com/u/silentdrummer)\
**Post date:** [January 20, 2022, 12:47pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/20 "2022-01-20T12:47:32Z")

</div>

Thanks @Dilon , but unfortunately it seems that Pragmaflow has removed all components from the marketplace:

> [@Every new beginning comes from some other beginnings end](https://forum.adalo.com/t/every-new-beginning-comes-from-some-other-beginnings-end/20485):
>
> Hi All, While getting set to release some GeoCoding components to help with converting addresses to lat/long and the reverse we ran into an issue. It is no longer possible to install components from our marketplace. For this reason we are shutting it down and will stop releasing components to the public. Sorry! We had a good run. Please do not message that you will pay for our components. That is not what we are about, and with the exchange of money comes obligations and support, so for $25 …

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [January 20, 2022, 12:48pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/21 "2022-01-20T12:48:45Z")

</div>

Yeah. Hope they will come back very soon!

> [@Every new beginning comes from some other beginnings end](https://forum.adalo.com/t/every-new-beginning-comes-from-some-other-beginnings-end/20485/71):
>
> I just wanted to post a quick update in this thread, we are anxiously awaiting the new API from Adalo which should be ready for us soon. When it is we will be back and better than ever.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [January 30, 2022, 12:49pm UTC](https://forum.adalo.com/t/chat-functionality-help/22109/22 "2022-01-30T12:49:34Z")

</div>

Closed on January 30, 2022, 12:49pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
