FREE OutSystems Workshops - Build an OutSystems App in 1 hour | ENROLL NOW

Tech Bites - Build a real time chat

< Back to Blog

Have you ever assumed how hard it seems to be to create a web chat app?

With OutSystems Reactive Apps building a chat, it’s fast and easy!


For our app, we need an entity called Message, containing the data about who sent a message, who’s the receiver, the message itself, and the date and time.


First, drag-and-drop a list widget. Assign it to the aggregate’s list.

Then, drag-and-drop the “Chat Message” pattern inside the list.

That pattern has placeholders for the data. Drag the user’s name and the text message inside those placeholders.


The time of the message is set on the widget’s properties. Set the time to the correspondent attribute.


One of the properties allows us to align the messages on the right if sent by the logged user. Set that property to “Get user id” equals “sent by” attribute value.

Let’s do something similar to the status, which can be “sent” or “received.” But in this case, let’s use the “if built-in function”: if the user sending the message is the same as the logged user, the message was sent. Otherwise, it was received. Thus, changing the icon below the message. 



With a simple input form that saves messages on the “Message Entity,” the user can now send messages.


Turn Up Academy

Apply to our Turn Up Boot Camp

AND BECOME THE NEXT OUTSYSTEMS CERTIFIED DEVELOPER
(
Instructor
)

Latest Articles

Tech Bites - How to integrate with a REST API

How to integrate with a REST API

In OutSystems, it's possible to integrate with a REST API in order to call an external service.

Tech Bites
Tech Bites - Make your forms look better

Make your forms look better

Let's see how to build a more modern form using OutSystems UI available tools.

Tech Bites
Tech Bites - How to edit the properties of several elements at the same time

How to edit the properties of several elements at the same time

This video will show you how to speed up the process by editing the properties of several elements at once.

Tech Bites