# Last comment

**URL:** https://community.glideapps.com/t/last-comment/58875
**Category:** Ask for Help
**Created:** [March 7, 2023, 2:01pm UTC](https://community.glideapps.com/t/last-comment/58875 "2023-03-07T14:01:55Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Sales\_Manager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sales_manager/32/16172_2.png) [@Sales\_Manager](https://community.glideapps.com/u/Sales_Manager)
#### Post date: [March 7, 2023, 2:01pm UTC](https://community.glideapps.com/t/last-comment/58875/1 "2023-03-07T14:01:55Z")

</div>

Welcome  
I want to get the date of the customer’s last comment.  
Any ideas to help me with that?

note:  
count of comments is more than 50K

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [March 7, 2023, 2:04pm UTC](https://community.glideapps.com/t/last-comment/58875/2 "2023-03-07T14:04:55Z")

</div>

Have you tried using a rollup column?

---

<div class="post-metadata">

### Author: ![Sales\_Manager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sales_manager/32/16172_2.png) [@Sales\_Manager](https://community.glideapps.com/u/Sales_Manager)
#### Post date: [March 7, 2023, 2:46pm UTC](https://community.glideapps.com/t/last-comment/58875/3 "2023-03-07T14:46:29Z")

</div>

First, how will I find the comment table?  
It is very difficult to bring more than 50K comments from google sheet to Glide  
Is there any other idea?

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [March 7, 2023, 2:55pm UTC](https://community.glideapps.com/t/last-comment/58875/4 "2023-03-07T14:55:42Z")

</div>

ahh, I see. App: comments.

What you probably want to do is create a separate Google Sheet, and then use a formula to pick out the most recent comment from each user. Then you can connect that sheet to your App.

I don’t know off the top of my head what the formula would be - it’s something I’d need to investigate.

---

<div class="post-metadata">

### Author: ![agung\_Taufik](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/agung_taufik/32/2589_2.png) [@agung\_Taufik](https://community.glideapps.com/u/agung_Taufik)
#### Post date: [March 7, 2023, 11:25pm UTC](https://community.glideapps.com/t/last-comment/58875/5 "2023-03-07T23:25:44Z")

</div>

Use the formula “array formula”

---

<div class="post-metadata">

### Author: ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)
#### Post date: [March 8, 2023, 5:22am UTC](https://community.glideapps.com/t/last-comment/58875/6 "2023-03-08T05:22:00Z")

</div>

Hey @agung_Taufik

That’s a hidden tab. We cannot access it inside glide, only in gsheets

Just create a new sheet and insert this formula. Then use the new sheet as a tab in the app.

`={'App: Comments'!A:Z}`

After this, do what @Darren_Murphy said to count the comments:

> [@Darren\_Murphy](#):
>
> using a rollup column

And a **Single Value** column \> Last \> to get the last comment

**Or** simply reorder the comment component to **newest first**

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [March 8, 2023, 6:14am UTC](https://community.glideapps.com/t/last-comment/58875/7 "2023-03-08T06:14:42Z")

</div>

@Lucas_Pires - I think the main issue is that the App:Comments sheet contains 50k rows, so it’s better to do the summary outside of Glide and then produce a smaller table with just one row per user, and then connect that to Glide.

I’m sure it would be possible to craft an array/query formula to do this. Although personally I’d probably just write a simple Apps Script function.

---

<div class="post-metadata">

### Author: ![sardamit](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sardamit/32/263_2.png) [@sardamit](https://community.glideapps.com/u/sardamit)
#### Post date: [March 8, 2023, 12:24pm UTC](https://community.glideapps.com/t/last-comment/58875/8 "2023-03-08T12:24:16Z")

</div>

> [@Darren\_Murphy](#):
>
> I’m sure it would be possible to craft an array/query formula to do this. Although personally I’d probably just write a simple Apps Script function.

MAXIFS at the user-level in the User’s table should work?

---

<div class="post-metadata">

### Author: ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)
#### Post date: [March 8, 2023, 12:45pm UTC](https://community.glideapps.com/t/last-comment/58875/9 "2023-03-08T12:45:31Z")

</div>

Oh yeah!

To display the last comment in a column in a Google Sheets spreadsheet in a particular cell, you can use the “INDEX” function combined with the “FILTER” function.

The formula to display the last comment in a column in a Google Sheets spreadsheet is as follows:

`=INDEX(FILTER(A2:A,A2:A<>""),COUNTA(A2:A))`

In this formula, “A2:A” is the column containing the comments, and the “FILTER” function is used to filter the non-empty values in that column. The “COUNTA” function is used to count the number of non-empty cells in the column. Then, the “INDEX” function is used to display the last comment by selecting the value at the position of the count of non-empty cells in the filtered column.

It’s important to remember that this formula only works if there is at least one comment in the specified column. Otherwise, it will return an error.

---

<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: [March 8, 2023, 11:56pm UTC](https://community.glideapps.com/t/last-comment/58875/10 "2023-03-08T23:56:35Z")

</div>

Wouldn’t this only work globally? Say I have multiple users then to get each “last date” then that should be a bit different?

---

<div class="post-metadata">

### Author: ![Sales\_Manager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sales_manager/32/16172_2.png) [@Sales\_Manager](https://community.glideapps.com/u/Sales_Manager)
#### Post date: [March 9, 2023, 11:51am UTC](https://community.glideapps.com/t/last-comment/58875/11 "2023-03-09T11:51:56Z")

</div>

I got what I wanted, thanks everyone.

I used a pivot table on the comments page by using (max) to get the latest date.

Then in the data page I used this formula

```auto
=ARRAYFORMULA(VLOOKUP($A:$A,'App: Comments'!$I:$K,2,0)) 

```
