I’m doing a chat system, everything works fine, but my RG is not organizing the messages correctly.
I need the messages to be shown in order of sending.
However my RG is organizing messages from the current user first, and then the other user, without a sending order.
You need to apply a sort on the data for the repeating group to sort it by date modified. Then you need to adjust the Display Descending Option to yes or no depending on how you want to view the data.
Yes, it was a solution, but I do two searches on my RG, one for messages from the current user and one for messages from the other user (Search for Messages merged with).
So this solution will not work as it should.
If you have any tips on how I can change this way of searching for messages, I would be grateful.
You should make a conversation type, and a message type linked to the conversation. If you only need 1:1 conversations, you method works. If you ever need group chat, or if you want to remove the :merge and :sort operations from happening in real time, you can apply this data structure very easily. Here is a short video I made a while back discussing it:
@duke.severn 's approach seems much better. But like he shows your data structure for chat seems a little off.
Here are a few more good recources for building chat into applications.
Echo Lake 3 part chat video
Air Dev Group Messenger
Paid App but Great Documentation
I solved it by adding “sorted by Created Date” at the end of the messages search.
Thanks for the solutions.
This topic was automatically closed after 70 days. New replies are no longer allowed.