Hi everyone,
I'm building an AppSheet app with two data sources:
Notes are displayed in a card view.
I'd like to show the number of comments on each card and order the notes by both note_date and comment_date. I'm having trouble finding a solution. Is this possible?
Solved! Go to Solution.
@exerlanda wrote:
I'd like to show the number of comments on each card
In the Notes table you would have a column called say [Related Notes] .
Please add another virtual column in the Notes table called say [Comments_Count] with an expression something like COUNT([Related Notes]) . [Comments_Count] will capture the number of comments for that note. Display that column in the Notes card view.
@exerlanda wrote:
order the notes by both note_date and comment_date. I'm having trouble finding a solution. Is this possible?
@exerlanda wrote:
both note_date and comment_date.
Please add a virtual column called say [Latest_Comment_Date] in the Notes table with an expression something like
MAX([Related Comments][Comment_Date])
where [Comment_Date] is the date column in the comments table.
Please create two card views
1. "Notes by Note date" . Use [Notes_Date] in the Notes table to sort descending that card view.
2. "Notes by Comment date" . Use [Latest_Comment_Date] in the Notes table to sort descending that card view.
Hi Suvrutt_Gurjar,
Thank you, it works fine.
I added a virtual column in notes called "comment_last_dateTime" with the formula MAX([Related comments][comment_dateTime]), and I keep only one view but I added two "sort by". The first one by "comment_last_dateTime" and the second by "note_date". I set "comment_dateTime = NOW()" by default, then everytime a comment is written, it is listed on the top. Great thank you for the help.
And for the count, I used the same idea, I created another virtual column called "comment_count" with the formula "COUNT([Related comments][comment_id])" and customize the layout to show the column in the card.
Wonderfull. Adding usermail as "note_name", it's create a perfect simple note taking app.
Thank you again.
User | Count |
---|---|
35 | |
11 | |
3 | |
3 | |
2 |