# Need help on creating private chat

**URL:** <https://community.glideapps.com/t/need-help-on-creating-private-chat/10686>\
**Category:** Ask for Help\
**Created:** [June 11, 2020, 7:27pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686 "2020-06-11T19:27:18Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.glideapps.com/u/Lisa)\
**Post date:** [June 25, 2020, 1:17am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/44 "2020-06-25T01:17:19Z")

</div>

For your first question, do you have “Make row owner” set on your user profiles sheet?

---

<div class="post-metadata">

**Author:** ![David\_Fefferman](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_fefferman/32/7594_2.png) [@David\_Fefferman](https://community.glideapps.com/u/David_Fefferman)\
**Post date:** [June 25, 2020, 1:26am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/45 "2020-06-25T01:26:18Z")

</div>

Clever work-around, Lisa! Man, I hope Glide gets a native private chat feature at some point…  
I do not have “make row owner” set in my user profile sheet.

---

<div class="post-metadata">

**Author:** ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.glideapps.com/u/Lisa)\
**Post date:** [June 25, 2020, 1:31am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/46 "2020-06-25T01:31:59Z")

</div>

I believe Jeff’s answer is right. Glide won’t pull in the value of the username lookup if the relation is set to “multiple”. It sounds right that when you unchecked the box, it broke a few things.

I’ve unfortunately had to rebuild a few times when I set the relation to multiple and later find I need it to pull in just a single value 😅

Once you recreate the lookups based on the single relation, you should be able to pull in the username.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 25, 2020, 2:00am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/47 "2020-06-25T02:00:16Z")

</div>

Thank you Lisa that makes sense 😄 👏

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [June 25, 2020, 2:10am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/48 "2020-06-25T02:10:44Z")

</div>

I don’t know why but I feel I have to make a little contribution to this thread again. I stayed away as much as I could from this thread knowing it was in safe hands, and it still is. But, please check [concepts.glideapp.io](http://concepts.glideapp.io). The solution to chat apps lies in concepts. It provides you with the building block/DNA of Glide chat apps. Master the concepts methodology and you can create not only 1on1 but also 1 on 20 user chat apps.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 25, 2020, 2:21am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/49 "2020-06-25T02:21:40Z")

</div>

@Wiz.Wazeer Man, if you keep plugging Concepts, I’m gonna have to get in there and do some updates. Some of that stuff is getting to be a year old. 😉

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [June 25, 2020, 2:23am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/50 "2020-06-25T02:23:26Z")

</div>

😍 😍 😍Yes I know…but as far as chat section goes…I cannot for the life of me work out what new things you can add to it! 🤣

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [June 25, 2020, 2:28am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/51 "2020-06-25T02:28:38Z")

</div>

Okay may be images…but that’s very easy.

---

<div class="post-metadata">

**Author:** ![Paquerette](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paquerette](https://community.glideapps.com/u/Paquerette)\
**Post date:** [June 29, 2020, 12:32pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/52 "2020-06-29T12:32:39Z")

</div>

Great tutorial Lisa ! Thanks a lot  
I just find some difficulties to display the right infos in the inline list for the chats. How to display the Name of the user via the relation column?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 29, 2020, 1:38pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/53 "2020-06-29T13:38:41Z")

</div>

Have you made any relations for the Sheets you are showing as the “Chat” tab?

---

<div class="post-metadata">

**Author:** ![Paquerette](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paquerette](https://community.glideapps.com/u/Paquerette)\
**Post date:** [June 29, 2020, 1:43pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/54 "2020-06-29T13:43:57Z")

</div>

I did, but I’m not sure I did it right 😕 Do you know where can I see an exemple in an existing template or tutorial?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 29, 2020, 1:47pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/55 "2020-06-29T13:47:49Z")

</div>

If you can share some screenshots here we will try to help.

---

<div class="post-metadata">

**Author:** ![Paquerette](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paquerette](https://community.glideapps.com/u/Paquerette)\
**Post date:** [June 29, 2020, 2:12pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/56 "2020-06-29T14:12:37Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/c/c70db15d498133547bfdaad2ed4ad86f07f8277b.png)

Here is my chat tab, I succeeded in getting the chat to work (via several relations to get the name and picture of the users), but how to fill the “last comment” column to be able to display it?

---

<div class="post-metadata">

**Author:** ![Tim\_Sullivan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/tim_sullivan/32/3461_2.png) [@Tim\_Sullivan](https://community.glideapps.com/u/Tim_Sullivan)\
**Post date:** [June 29, 2020, 2:19pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/57 "2020-06-29T14:19:39Z")

</div>

> [@Jeff\_Hager](#):
>
> Some of that stuff is getting to be a year old.

That’s a lifetime in Glide years.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 29, 2020, 2:26pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/58 "2020-06-29T14:26:16Z")

</div>

If you want to do it in the Sheets, make an arrayformula combine with VLOOKUP that looks up the latest comment matching with the unique topic ID.

If you want to do it in Glide’s data editor, copy the ‘App: Comments’ sheet to a new sheet that you can see in Glide (via a filter formula, ideally), then:

- Make a relation to return the rollup that shows the latest comment timestamp of each chat topic/ID.

- Make a template column joining that rollup and the chat topic/ID in the Chats sheet (containing topics), make the same template column in the Comments sheet (containing chats).

- Make a relation - lookup of that template column in the Chats sheet to take back the latest Comments.

---

<div class="post-metadata">

**Author:** ![Paquerette](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paquerette](https://community.glideapps.com/u/Paquerette)\
**Post date:** [June 29, 2020, 2:57pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/59 "2020-06-29T14:57:49Z")

</div>

> [@ThinhDinh](#):
>
> arrayformula

Nice idea ! The sheets solution works yell, but how do I add it automatically when a new row is added?

 ![Capture](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/e/e42fc080f7b6dfbc95d817641a3fed14acd9cfbc.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 29, 2020, 3:11pm UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/60 "2020-06-29T15:11:13Z")

</div>

That’s why I mentioned the arrayformula so it automatically calculates when a new row (of topic) is added.

I have written about the use of it here:

> [@Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts](https://community.glideapps.com/t/tutorial-arrayformula-in-google-sheets-good-practices-how-to-overcome-arrayformula-restrictions-with-scripts/9727):
>
> Hi, Today I will show you the script that can make copying formulas down work, when it does not work with arrayformula. But first, let’s have some introductions about arrayformula, for those who has not used this before in Google Sheets, some equivalents in Glide and some good practices while using it. I hope it can help you in building your Glide apps as well as applying it in your normal day job. 
> 
> > **1/ Definition**
> >
> > Arrayformula is defined as “a range, mathematical expression using one cell range …

If you need help with creating the arrayformula, feel free to tell me.

---

<div class="post-metadata">

**Author:** ![Paquerette](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paquerette](https://community.glideapps.com/u/Paquerette)\
**Post date:** [June 30, 2020, 9:27am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/61 "2020-06-30T09:27:04Z")

</div>

Hello ThinhDinh,

I tried some formula, but I think this is way above my excel knowledge ! ☹

I try to get the content from column F, if the ID in B column is the latest one found by a LOOKUP

![Capture](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/d/dec60cb9a841393569a53d98543a5dab16119177.png)

Any Idea? Thank you for your time !

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 30, 2020, 10:12am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/62 "2020-06-30T10:12:04Z")

</div>

I think you have the “Topics” sheet already right, and this is the Comments sheet.

A combination of VLOOKUP and SORT would do it. Assuming you store the topic/topic ID in column A of the “Topics” sheet, and in the Comments sheet the matching topic/topic ID is in column B.

```
=ARRAYFORMULA(IF(A2:A<>"",VLOOKUP(SORT('App: Comments'!B2:F,4,FALSE),5,FALSE),""))

```

Explanation: I sort the App: Comments sheet by column 4, which is the timestamp, in descending order. Then the VLOOKUP will return its first match, by design, so it will have the latest message back to your Topics sheet.

---

<div class="post-metadata">

**Author:** ![Paquerette](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paquerette](https://community.glideapps.com/u/Paquerette)\
**Post date:** [June 30, 2020, 11:24am UTC](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686/63 "2020-06-30T11:24:06Z")

</div>

> [@ThinhDinh](#):
>
> `ARRAYFORMULA`

Thanks a lot !

I used this formula, it works well :

```
=SI(A2<>"",SIERREUR(RECHERCHEV(A2, SORT('App: Comments'!B:F,5,VRAI),5,FAUX),"Nouvelle Discussion"),"")

```

I’m not sure what ARRAYFORMULA would bring more ?

[Previous page](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686.md?page=2)

[Next page](https://community.glideapps.com/t/need-help-on-creating-private-chat/10686.md?page=4)
