Comment Thread

A widget to facilitate conversations among app users. It supports timestamps, customizable avatars, submit handler and invocation via API.

Properties

Available properties for Comment Thread with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.

NameTypeDescriptionvaluestring

The current value of the input

autoRefreshIntervalnumber

Automatically refresh the comment thread at this interval (milliseconds). 0 for no automatic refresh.

avatarFallbackstring

The fallback text to display if there is no image or icon

avatarIconIconKey

The avatar icon to display

avatarImageSize16 | 24 | 32 | 40 | 48

The size of the avatar image, in pixels

avatarSrcstring

The avatar source URL

data{ [key: string]: unknown }[]

The data for the comment thread

disableSubmitboolean

Disables comment thread input and submit button.

emptyDescriptionstring

The description to display when there are no messages in the comment thread

emptyTitlestring

The title to display when there are no messages in the comment thread

hiddenboolean

Whether the component is visible.

maintainSpaceWhenHiddenboolean

Whether the component takes up space on the canvas if hidden is true.

marginstring

The amount of margin to render outside of the component.

placeholderstring

What to show when the input is blank

showAvatarboolean

Whether to display the avatar

showEmptyStateboolean

Whether to display text when there are no messages in the comment thread

showInEditorboolean

Whether the component remains visible in the editor if hidden is true.

showTimestampboolean

Whether to display a timestamp

showTitleboolean

Whether to display the title

threadIdstring

The ID of the comment thread

titlestring

The title of the comment thread

Events

Events are triggered by user interactions with Comment Thread. Use event handling to trigger queries or other actions in response to events.

NameDescriptionSubmit

A user submits a comment

Click action

A user clicks an action button on a comment

Methods

Methods for interacting with Comment Thread. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.

NameDescriptionsetValue(value: boolean | string | number | void)

Set the current value.

clearValue()

Clear the current value.

scrollIntoView(options: any)

Scrolls the canvas or parent container so that the selected component appears in the visible area.

setHidden(hidden: boolean)

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

resetValue()

Reset value to the default value.

exportData(options: any)

Export comments in the current thread as a file in a CSV, TSV, JSON, or Excel format.

sendMessage(message: string)

Submit a comment to the thread.