# Collapse and expand a text message with the Show more/less button

# About the feature

If you send a long message to a chat user, add a Show more button to show them a collapsed version of the message.

image

To expand the message to its full length, the chat user clicks Show more. To collapse - Show less.

image

Receiving a new message does not affect the state of the Show more / Show less button in the previous message. For example, if the message is expanded, receiving a new message won't collapse the previous one.

The feature applies only to the Text messages built with the Send message Step template. It can't be applied to the texts in the Widget.

You can set the necessary length of the collapsed message in the number of rows.

# How to add the Show more/less button to the message

# Prerequisites

Note, that you can either collapse the message with the Show more/less button or show it in the typing mode at its full length. That is why, once you enable the Allow to collapse or expand text message toggle, it automatically disables the Show text message in typing mode toggle in the Advanced settings of the Send message (RWC) Step.

# Instruction

  1. Open the Send message (RWC) Step where you want to add the button.
  2. In the Massage content section, enable the Allow to collapse or expand text message toggle. The Max rows in collapsed state field becomes available.
    • If the Message type is Random or Conditional, configure the Allow to collapse or expand text message toggle for every version of the message separately.
  3. In Max rows in collapsed state, either provide the number from 1 to 60 or click {X} and pass the value with the Merge field (opens new window).
  4. Save & Activate the Flow.

# Result

In the chat, this text message shows only the set number of rows with the Show more button at the end.

If the Max rows in collapsed state value is bigger than the number of rows in the message, it won't collapse and the Show more button won't appear in the chat. Note, that the number of rows in the message depends on the chat style and view (desktop, embedded, mobile, and Apps). So the text of 300 symbols will have different numbers of rows in different chat styles and views.

It the message was in typing mode, it got disabled.

Last Updated: 11/20/2023, 4:43:13 PM