icon picker
Messaging / Chat

What this is:

You want your users to be able to have a back-and-forth conversation in your app.

How I do it:

Create an “Conversation” data type with these fields:
Field Name
Field Type
DT/OS
List
Notes
Users
All users in the conversation
Related [Data Type]
If the conversation is regarding something specific like a project. (Many apps don’t need this field.)
No results from filter
And then create a “Message” data type with these fields:
Field Name
Field Type
DT/OS
List
Notes
Body
User (Sender)
Will be empty if it’s a “system” message
Seen By
The sender is automatically added to this field.
Date Sent
Files
If you’re allowing users to send files or photos, you’ll need a field for that.
Sender Type
Allows for “system” messages like “Invoice paid”
Related [Data Type]
If you want users to be able to attach specific things from the database (like, for example, an invoice).
Conversation
🔒 Users in Conversation
This is for the purpose of Privacy Rules
No results from filter

Notes:

About the “Seen By” field: c
Where the relationship lives: It’s important that the relationship between the messages and the conversation lives on the message field, rather than having a list of messages on the conversation field. This is because there is a limit to the number of records that can go in a list field, and if a conversation gets very long, you could max it out.
The “🔒 Users in Conversation” field: This field is not used for any purpose other than privacy rules. It allows you to lock down the “Messages” data type so that only people who are in the conversation can view the conversation’s messages. The privacy rule would look like this: This message’s “🔒Users in Conversation” contains Current User .

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.