View this page in the latest version of Appian. Chat Message Share Share via LinkedIn Reddit Email Copy Link Print On This Page The capabilities described on this page are included in Appian's advanced and premium capability tiers. Usage limits may apply. Function a!chatMessage( messageContent, role, showWhen ) Creates a ChatMessage object for use in the messages parameter of a!chatField. Parameters Name Keyword Types Description Message Content messageContent Any Type The message you want to display in a!chatField. Role role Text The user type that sent the message. Valid values: "USER", "ASSISTANT". Show When showWhen Boolean Determines whether the message is displayed on the interface. When set to false, the message is hidden and is not evaluated. Default: true. Usage considerations Using the role parameter The role parameter identifies who sent the message: USER: Represents messages sent by the end user. ASSISTANT: Represents messages sent by the AI model. Using the messageContent parameter The messageContent parameter accepts: Plain text: For simple messages with default styling. Components: For custom formatting using any Appian component or layout. Examples Basic chat message This example creates a simple chat message from the assistant. 1 2 3 4 a!chatMessage( role: "ASSISTANT", messageContent: "Hello! How can I help you today?" ) Chat message with custom content This example creates a chat message with rich text formatting. 1 2 3 4 5 6 7 8 9 10 11 a!chatMessage( role: "USER", messageContent: a!richTextDisplayField( value: { a!richTextItem( text: "Can you help me with my order?", style: "STRONG" ) } ) ) Conditional chat message This example shows a message only when a condition is met. 1 2 3 4 5 a!chatMessage( role: "ASSISTANT", messageContent: "Your order has been confirmed.", showWhen: local!orderConfirmed ) Feature compatibility The table below lists this component's compatibility with various features in Appian. Feature Compatibility Note Portals Incompatible Offline Interfaces Incompatible Sync-Time Custom Record Fields Incompatible Real-Time Custom Record Fields Incompatible Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. Process Reports Incompatible Cannot be used to configure a process report. Process Events Incompatible Cannot be used to configure a process event node, such as a start event or timer event. Process Autoscaling Incompatible Cannot be used in autoscaled processes. Event Consumer Filter Conditions Compatible Can be used in filter conditions. Event Consumer Event Handlers Compatible Can be used in event handler expressions. Related recipes The following recipes include usage of the Chat Message. Build a Chatbot with Persistent History (Chat, AI): Create a chatbot that maintains conversation continuity by storing and retrieving message history from a record type. Build an AI Chat with Real-Time Streaming and Persistent History (Chat, AI): Build an AI chat interface with real-time streaming responses and persistent conversation history using the Chat Field component. Feedback Was this page helpful? SHARE FEEDBACK Loading...