So I have a list of chatrooms and I was wondering how to sort it by the date the last message was sent, the newest at the top and the oldest at the bottom? and also I want to display the latest message sent in the chatroom as a subtitle, is this possible?
Hello, in order to do that, in my opinion the easiest way to do that is by having an extra property for the Chatroom collection in the DB, called “Last Message” and every time the user send a message, that property is updated. So in the case just display it in the subtitle and make the sorting “Updated newest to oldest”
You can create a Date and Time property on the Conversation collection and name it as like Last message sent date and add a Update current conversation action and fill that field with current time and sort the list as Last message send date - Newest to Oldest.