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

‍What’s new in OutSystems Developer Cloud

‍What’s new in OutSystems Developer Cloud

Have you heard about the OutSystems Developer Cloud and want to know more about what's new and what the big benefits are? Then this article is for you!

DevZone
Tech Bites - Should we validate form data on server-side?

Should we validate form data on server-side

When including forms in applications, developers often wonder if they need to re-validate data on the server side after having checked it on the client. Why go to the trouble of checking the data twice?

Tech Bites
The Top 5 Mistakes Handling Asynchronous Data In Outsystems Reactive Apps And How To Avoid Them

The Top 5 Mistakes Handling Asynchronous Data In Outsystems Reactive Apps

When developing an OutSystems reactive web app, you would expect to display data quickly, but it doesn't always happen. Do you know why? We'll explore the reasons and how to tackle them.

DevZone