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

How to download Excel files in OutSystems

How to download Excel files in OutSystems

Learn how to download Excel files using the OutSystems platform in this simple tutorial!

DevZone
Mastering Email Integration with OutSystems: A Step-by-Step Guide

Mastering Email Integration with OutSystems

In OutSystems Reactive Web Applications, we can configure the Service Center and implement logic in the Service Studio to send emails to our peers or contacts. Follow this step-by-step guide to learn how to!

DevZone
How to use WebAssembly inside OutSystems - Part 2

How to use WebAssembly inside OutSystems - Part 2

WebAssembly (WASM) is a new technology that is getting a lot of attention. We continue the use of Go compiled to WASM to show how we can use WASM inside OutSystems.

DevZone