Unify Applications
Logo
Chat & Comments

Chat & Comments

Logo

8 mins READ

Chat

The Chat block renders a live, two-sided conversation — a scrollable thread of messages between a customer and your team — inside an interface. It is a composite block pre-wired with a message composer in its Message Input slot. Messages stream in real time, older history loads as you scroll up, and message bodies render as rich HTML.

Each conversation is a case: a conversation record with its own case ID, which you pass to the block as the Chat Key. The block loads history and sends replies through the automations set in your workspace's chat configuration; you don't pick automations on the block. If the workspace has no chat configuration, the block stays in a loading state and never shows the conversation.

unify-applications-chat-and-comments-01-chat-block.png
unify-applications-chat-and-comments-01-chat-block.png

Tip: When to use Chat: Embed a customer-support conversation on a page — a running thread where your team replies. Not for AI assistants (use Copilot Chat). Not for threaded comments on records (use the comment blocks). If you only need the composer box without the thread, use Message Input.

Properties

Content

Property

Type

Default

Description

chatId

string (bindable)

—

Shown as Chat Key. The ID of an existing conversation (case) to show. Leave empty to start a new conversation; the case is created when the first message is sent.

slots.messageInputPanel

slot (holds block subtree)

Stack holding a Message Input (attachments + Send actions)

The composer docked below the thread. Already wired: its Send action's On Click calls the Chat's Send Message method with the composer's text and attachments, so you don't need to add anything. Restyle or extend the blocks inside.

Appearance

PropertyTypeDefaultDescription
layout"BUBBLE"BUBBLEMessage bubble styling. Fixed to Bubble — not exposed in the inspector.
visibilitycondition—Shows or hides the block.

Methods

MethodParamsEffect
Send Messagemessage, attachmentsProgrammatically sends a message into the conversation.

Exposed State

State key

Type

Description

{{ id.content.chatId }}

string

The active conversation's case ID. For a new conversation, it is filled in once the first message is sent. It is not saved — store it yourself in the action that sends the first message.

Behavior & Gotchas

Note: The block fills in the case ID after the first message. For new conversations (no Chat Key set), after the first message is sent the block fills in {{ id.content.chatId }} with the created case's ID. This value is not saved anywhere — store it in your data in the action that sends the first message.

Comments

The Comments block is a complete commenting experience — composer, thread, and replies — in one block. Object mode attaches the thread to a record of one of your objects and handles loading/saving automatically. Mapped mode gives you two slots (a Comment Input and a Comment List) that you wire to your own data. Both modes support rich text or plain text, @-mentions, attachments, emoji, reply threads, and top-to-bottom or bottom-to-top display.

Tip: When to use: Add discussion to a record (ticket, document, task) with zero backend work — pick Object mode, select the object and record id. Use Mapped mode when comments live in your own tables or APIs. Use the standalone Comment Input or Comment List blocks directly when you need a layout this block's two-slot arrangement can't express.

Properties

Property

Type

Default

Description

Source (source)

Object or Mapped

Object

Object mode stores comments on a record for you. Mapped mode uses your own data.

Select object (data)

object selector

—

Object mode only. The object whose records carry the comment threads.

Record Id (assetId)

string

—

Object mode only. Which record's thread to show — typically a dynamic value like the current page's record id.

Variant (variant)

Rich text or plain text

Rich text

Rich text (with a formatting toolbar) or plain text composing.

enterKeyBehavior

"START_NEWLINE" | "SEND_MESSAGE"

START_NEWLINE

What pressing Enter does while writing. START_NEWLINE: Enter adds a line; cmd/ctrl + Enter sends.

Add Ons

The Add Ons section of the Comments block turns on extra features. Switch on the ones you need and set their options there.

Add-on

What it does

Reply to comment

Adds a reply action to each comment.

Delete comment

Adds a delete action to each comment.

Time Format

Sets how each comment's timestamp is shown.

Attachments

Lets users attach files to a comment.

Emoji Picker

Adds an emoji picker to the composer.

Toggle Formatting

Lets users show or hide the formatting toolbar while writing.

User Mentions

Lets users @-mention people, using the users you map.

Comments — Mapped Mode

With Source set to Mapped, the block creates two slots for you: a Comment Input with an Add Comment action and a Comment List with a Reply add-on. Nothing is stored for you, so wire both:

  1. Set Source to Mapped.

  2. Select the Comment List slot and map its comments source (id, content, created time, attachments, user details). See Comment List below.

  3. Select the Comment Input slot. In its On Add Comment event, save the comment to your data, then refresh the list's source.

  4. On the Comment List, handle On Add Reply and, if you turn on Delete comment, On Delete Comment to save those changes.

Comments — Events

Event

Trigger

Available when

On Add Comment

The user posts a comment.

Object mode

On Add Reply

The user posts a reply.

Object mode

On Attachment Click

The user clicks a comment's attachment. Payload: clickedAttachment.

Object mode

In Mapped mode, use the events of the Comment Input and Comment List slots instead.

Comments — Exposed State

State key

Type

Description

{{ id.events.onAttachmentClick.clickedAttachment }}

object

The attachment last clicked.

{{ id.userMentionSearchString }}

string

What the user typed after @ when User Mentions is on.

Comment List

The Comment List block renders a thread of comments coming from your own data source. You map which fields hold each comment's id, content, timestamp, attachments, and author, and the block renders the conversation. It supports optional per-comment delete and reply actions, reply threads fetched on demand from a second source, and a configurable timestamp format. The block never stores comments itself — every add, reply, and delete raises an event for your app to persist.

Tip: When to use: Render a comment thread from any backend you own. Pair with Comment Input for the composer. Use Comments block instead when you want the whole experience pre-wired in one block.

Properties

PropertyTypeDefaultDescription
datasource + field mappings—Comment source with field mappings: id, content, createdTime, attachments, and user details (name, profileImageUrl).
addOns.deleteCommenttoggle—Adds a delete action to each comment.
addOns.replyCommenttoggle—Adds a reply action with its own composer and a separate replies source.
addOns.datetimeFormatformat string—Controls how each comment's timestamp is displayed.
size"sm" | "md"mdComment density.

Events

Event

Trigger

On Delete Comment

User clicks the delete action on a comment. Payload: commentId of the deleted comment.

On Add Reply

User submits a reply in the reply composer (set on its Add Reply action). Payload: the reply text, attachments and parentCommentId.

On Attachment Click

User clicks a comment's attachment. Payload: clickedAttachment.

The list removes a deleted comment and shows a new reply immediately, before your event runs. Save the change in the event, or the next data refresh brings the old state back.

Comment List — Exposed State

State key

Type

Description

{{ id.events.onDeleteComment.commentId }}

string

ID of the last deleted comment.

{{ id.events.onAddReply.value }}

string

Text of the last reply sent.

{{ id.events.onAddReply.attachments }}

array

Files attached to the last reply.

{{ id.events.onAddReply.parentCommentId }}

string

The comment the reply was posted under.

{{ id.commentIdToFetchReplies }}

string

The comment whose replies are being fetched. Filter your replies source with it.

Comment Input

The Comment Input block is a composer for writing comments, in either a rich text or plain text variant. It supports @-mentions of users from your own data, file attachments, an emoji picker, formatting controls, and a configurable Enter-key behavior. The block holds the draft text and attachments in its state and fires an event when the user sends — your app decides what "posting a comment" actually does.

Properties

Property

Type

Default

Description

variant

"richText" | "textarea"

richText

Rich text (formatted, with toolbar) or plain text.

enterKeyBehavior

"START_NEWLINE" | "SEND_MESSAGE"

START_NEWLINE

What pressing Enter does.

extensionConfigFeatures

feature toggles

All standard on

Rich text only. (optional) Which formatting marks, lists, links, etc. are enabled.

Events

Event

Trigger

On Add Comment

Set on the composer's Add Comment action. Fires when the user submits the comment. Payload: the comment text and any attachments.

Methods

Method

Params

Effect

setContent

value, attachments

Sets the text and attachments in the composer.

Message Input

The Message Input block is a chat-style composer: a text box with a configurable row of action buttons — send, add attachments, emoji picker, or custom buttons. It types in Rich Text or Plain Text mode, supports voice dictation, and can be linked to a Chat block. A new standalone Message Input arrives compact and full-width with a rounded border and a Send button; nothing is sent until you wire the Send button's On Click. The composer that comes inside a Chat block's Message Input slot is different: it is already wired to the Chat's Send Message method.

Tip: When to use: Compose and send chat messages — pair with a Chat block. Collect free-form text with attachments and a submit button in one compact control. For a plain form field that submits with a form, prefer a Form block text field instead.

Properties

Property

Type

Default

Description

chatId

block reference (Chat only)

—

Links the composer to a Chat block. When linked and the customer's latest message arrived by email, a To: line with the customer's name appears above the text box. For other channels nothing extra is shown.

mode

"compact" | "default"

compact

Compact or comfortable spacing for the composer.

variant

"richText" | "textarea"

richText

Whether the text box supports formatting.

enterKeyBehavior

"START_NEWLINE" | "SEND_MESSAGE"

START_NEWLINE

What Enter does — new line or send.

placeholder

string

—

Hint text shown while the box is empty.

Autofocus (autoFocus)

boolean

On

Puts the cursor in the text box when the block loads. Turn it off if you don't want the page to jump to the composer.

actions

action list

Send action

Configurable action buttons: Add Attachments, Submit Message (with an optional Dictation add-on), Emoji Picker (Rich Text only), or custom buttons.

Events

Event

Trigger

On Click

Set on a toolbar action, e.g. Submit Message. Fires when the user clicks that action. Read the text from {{ id.value }} and files from {{ id.attachments }}.

Methods

Method

Params

Effect

setValue

content

Replaces the text in the box. Use it to pre-fill the composer. It does not send.

startDictation

—

Starts voice dictation into the box.

stopDictation

—

Stops voice dictation.

reset

—

Clears the text and attachments, and switches autofocus off.

Exposed State

State keyTypeDescription
{{ id.value }}stringThe current text in the composer.
{{ id.attachments }}arrayFiles attached to the pending message.
BlockRelationship
Copilot ChatAI assistant transcript — use for agent conversations, not human messaging.
Copilot InputThe message composer for copilot conversations (vs. Message Input for human chat).
FAQs

What is the Chat Key and why does it matter?

The Chat Key (chatId property on the Chat block) is the ID of an existing conversation (case). Leave it empty to start a new conversation — the case is created when the first message is sent, and its ID is then available on the block as {{ id.content.chatId }}. Save that ID in the same action that sends the first message, and bind Chat Key to the saved case ID to reopen the thread later. A value that is not a case ID (for example, a ticket number) shows an empty thread.

When should I use Object mode versus Mapped mode in the Comments block?

Object mode is the default and easiest to set up: you provide an assetId and UnifyApps automatically stores and retrieves all comments against that asset. Use Object mode when you want comments managed entirely by the platform with no custom data layer. Mapped mode connects to your own data source, where comments are records you control. Use Mapped mode when you need to query, filter, or store comments in your own database structure, or when you need to integrate with an existing comment system.

How do I let users reply to specific comments in a Comment List?

Turn on the Reply to comment add-on on the Comment List block and configure its replies source. Each comment gets its own reply composer. Wire the On Add Reply event to save the reply under {{ id.events.onAddReply.parentCommentId }} so the thread structure is kept.

Can the Message Input block be used independently, without a Chat block?

Yes. Message Input is a standalone composer. Its send button only fires an On Click event — set on the Submit Message action — and nothing is sent until you wire that event. Without a Chat block, route {{ id.value }} and {{ id.attachments }} to any destination, for example an automation. Linking a Chat block (the chatId property) only shows the recipient row; it does not send. To send to the chat, add an On Click interaction on the Submit Message action and call the Chat block's Send Message method with the composer's value and attachments.