# Turn on Like and Dislike user reactions to the message

# About the feature

A chat user can Like or Dislike a message.

They can provide optional feedback in the case of a Dislike. The Provide additional feedback dialog is standard, you cannot change it.

Chat users can add reactions to any message with turned-on reactions during the conversation. Reactions remain available for the whole duration of the conversation.

If a conversation history is on for a chat, recorded Likes and Dislikes are available to view. A chat user cannot react to messages in past conversations that have ended.

If later in the Flow you use the Change or Delete Message (RWC) Step to change the message with a reaction, the content of the said message changes, but the reaction remains. If you delete the message with a reaction using the same Step, the reaction gets deleted together with the message bubble.

The feature is available for messages created with:

  • Send Message (RWC)
  • Request Response (RWC)

# Handling the like and dislike legs of the Step

When the Allow message reaction (Like/Dislike) setting is enabled in the Step, it creates the like and dislike legs for the Step.

The like and dislike legs must be handled. Otherwise, when a chat user leaves a reaction to the message in the chat, it won't be recorded in the logs and you can't find out easily about the reaction. Though the Merge fields for the reaction are available.

If the like or dislike leg has any RWC Steps, this leg must end with the Go to a Step in Current Flow or the Return to Main Thread (RWC) Step to return a user to the main conversation. Otherwise, after the logic of this leg is executed, a chat user cannot continue the conversation in the main thread.

If the like or dislike has non-RWC Steps, no need to add an extra Step to reroute a chat user back to the main thread because no RWC message exchange takes place in this like or dislike leg. For example, the like or dislike leg has a Step to record user reaction to a database.

# Instruction

To turn on user reactions to a message:

  1. In the Flow, click the Send Message (RWC) or Request Response (RWC) Step with a message you want to turn on user reactions for.
  2. In the Configuration panel, in the Advanced settings section of the Step, turn on Allow message reaction (Like/Dislike). It creates the like and dislike legs for the Step.
  3. Handle the like and dislike legs. If you add any RWC Steps to the like or dislike leg, use the Go to a Step in Current Flow or the Return to Main Thread (RWC) Step at the end of this leg. If you add non-RWC Steps to the like and dislike leg, no need to add extra Steps to reroute a user to the main thread.
  4. Save & Activate the Flow.

# Result

In the chat, the Like or Dislike reaction is available for the message. The Provide additional feedback dialog pops up in the case of a Dislike where the user can write extra info and tick reasons for the Dilsike or cancel the reaction. Once a user submits Dislike or clicks Like, only the chosen reaction remains for the message. It notifies a user their reaction has been recorded.

# Recording and passing reactions

When the Allow message reaction (Like/Dislike) is on, the Step has the following Merge fields (opens new window) to record and pass the data about the user reaction:

  • ​stepName​.reactionType​ - Like or a Dislike of the chat user.
  • stepName​.reactionFeedback- a string containing a feedback message in the case of Dislike.
  • stepName​.reactionReasons- reason(s) for a Dilsike a chat user ticked. In the form of an array.
  • ​stepName​.reactionReasons[0]- the reason for a Dislike from the array.

# Output structure for reactions

{
  "reactionType": "dislike", // value can be - "like"
  "reactionFeedback": "Your message does not fit the context!", // can be - "undefined"
  "reactionReasons": [ // value can be - "undefined"
      "inaccurate",
      "harmful",
      "not_helpful" ],
}
Last Updated: 12/7/2023, 6:56:08 PM