Has anyone built a basic messaging system?

Hey all,

One of the features I want to add to my “habit installer” app is an accountability buddy feature, where you can see if a buddy is doing there habits, and send them a message of encouragement.

One of the things this will require is build a basic messaging system that saves all messages from and to, shows which ones have been read, and notifies you when you have new messages.

I can certainly build this all myself, but it occured to me that someone else may have already done this for another use case. Has anyone already made this?

Hey @Matt_Goldenberg I think this would really come down to what do you consider ‘messaging’ and what works in your application. I’ve successfully used the Gmail Pack, the Twilio Pack and the Slack Pack. All can send messages, and have different strengths and weaknesses. Do you want to push a one way outbound? Have a dialogue? Conditional logic?

Flush out your use case and then you can zero in on how to build it.

I looked into all those but none of them really fit my use case for free, real time communication. Rather, I want to build the function into coda itself (or alternatively, if there was a free api out there I could connect to coda that had real time messaging I’d use that).

This is why I’m asking if anyone has built the functionality into coda.

So you want to have the conversation in the Coda.io document? Its not clear what your vision is.

Yes exactly. Just like the basic inbox/conversation/personal messages feature on most social websites.

Hmm. It’s still not clear to me. I guess what comes up is you could have a single row, 2 column table [Message] [Submit Button] where you could type a message and then press submit. That would push it to a table that logged all the messages, time, submitter user. Then you could create another view that showed the last X messages.

Basic Schema


[Message] [Submit Button]

[Last 5 Messages (Message_Table.slice(0,5))]

[Message_Table]


That make sense?

Yeup, seems pretty straightforward to build, just time consuming, that’s why I figured I’d ask if someone has already built it.

OK @Matt_Goldenberg this what you’re looking for? As a testament to the power of Coda.io I was able to build this for you in 8 minutes :smiley:

3 Likes

Took a while, but I got this built!

Hi. Im new with Coda and stumbled upon this Messaging System. I hope I can copy this or replicate it. This is exactly what I need for a project at work.

1 Like

HI @RC_Chavez and Welcome to the Community :partying_face: !

You can replicate the example of @Johg_Ananda fairly easily :blush:

The first table is just a one row helper table with 2 fields :

  1. A text field to enter the message you’d like to send
  2. A button to effectively send the message and probably “reset” the field to blank ("") once it’s done

The second table is the table acting as an “Inbox” and will store all the messages as well as some info about them :blush:

So, in that table there is :

  1. A text field to store the message

  2. You could use a Date/Time field to store the moment the message was received in the “Inbox” table and choose as value for new rows: date and time created (it’s just an idea, as it was done differently in the sample above)

  3. Either a text field like in the sample or a People field to store the “Sender” of the message

As for the Action formula for the button in the one row helper table, you could use something like this :

RunActions(
  AddRow(
    Inbox,
    Inbox.Message,
    thisRow.Message,
    Inbox.Sender,
    User()
  ),
  ModifyRows(
    thisRow,
    thisRow.Message,
    ""
  )
)

So, it’s a 2 actions button where the first action is :

AddRow(
    Inbox,
    Inbox.Message,
    thisRow.Message,
    Inbox.Sender,
    User()
  )

And it simply add a row to the table meant to store the messages where the value to put in the field for the message is thisRow.Message and the value to put in the field for the sender is the current user (User()) who push the button :blush: .

In my quick test, as I chose to create the timestamp using the date and time created as value for new rows, I didn’t need to precise the value to add in the button for that field.
But if you need it or prefer to timestamp the message when the button is effectively pushed instead of when the row is added in the table you could use Now() for this value in that field :blush: .

The second action of the button is:

ModifyRows(
    thisRow,
    thisRow.Message,
    ""
  )

And it just resets the value in the text field in the one row helper table to Blank("") .

After that, if you wish to avoid sending blank messaged to the “Inbox” table, you can add a Disable if formula such as :

thisRow.Message.IsBlank()

So the button will be disabled while the text field is still empty :blush: .

And that’s pretty much it I think :innocent:
And there are probably other ways to get something similar too :blush:

I hope this helps :innocent: !

1 Like