Send Chat Message

Send Chat Message

 

In this article

Overview

You can use this Snap to send a chat message using the specified Chat ID.

send-chat-msg-snap-overview.png

 

Snap Type

Send Message as Chat Snap is a Write-type Snap that sends a text message to a user.

Support for Ultra Pipelines

Works in Ultra Pipelines.  

Limitations

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

 

  • Min: 0

  • Max: 1

  • Mapper

  • Copy

The input includes:

  • Message content - The actual text/content you want to send.

  • Target information - Details about where to send the message (channel or user).

Output

Document

 

  • Min: 0

  • Max: 1

  • Mapper Snap

  • Copy Snap

  • JSON Formatter + File Writer

The typical output includes:

  • Message ID - Unique identifier for the sent message

  • Timestamp - Epoch timestamp (e.g., 1601469028) that can be used for:

    • Replying to the message using the "Timestamp (if thread reply)" field

    • Updating the message with the Update Message Snap

  • Channel/User details - Information about the recipient

  • Status information - Confirmation of successful delivery

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab:

  • Stop Pipeline Execution: Stops the current pipeline execution if the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the remaining records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

  • Expression : JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.

  • SnapGPT : Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.

  • Suggestion : Populates a list of values dynamically based on your Account configuration.

  • Upload : Uploads files. Learn more.

Learn more about the icons in the Snap Settings dialog.

Field Name

Field Type

Description

Field Name

Field Type

Description

Label*

 

 

String

The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

 

Default ValueSend Chat Message
ExampleSend Chat Message

Message

 

 

String/Expression

The actual content to send to the user. This Snap supports the following message formats:

HTML formatted message:

<h1>Welcome to the Team!</h1> <p>We're excited to have you join our project team.</p> <ul> <li>Check your email for onboarding materials</li> <li>Join our next team meeting on Friday</li> <li>Don't hesitate to reach out with questions</li> </ul>

Message with data from upstream Snaps:

"New order received: Order ID: " + $orderId + " Customer: " + $customerName + " Amount: $" + $orderAmount + " Delivery Date: " + $deliveryDate

Dynamic Message Using Expressions

"Hello " + $firstName + "! Your request #" + $reques

Rich Text with Emojis and Formatting

<h2>🎉 Congratulations!</h2> <p>Your project milestone has been achieved!</p> <p><strong>Achievement:</strong> Database migration completed</p> <p><em>Great work team! 👏</em></p>

 

Default Value: None
Example: “Hello, this is a test message”

Chat ID

String/Expression/Suggestion

The unique identifier of the chat conversation where you want to send your message. You can obtain Chat IDs using the following methods:

  • From Microsoft Graph API: GET https://graph.microsoft.com/v1.0/me/chats

  • From Teams List Operations Snap: Use the Teams Team Operations Snap with "List Channels" operation to get channel-based chat IDs.

  • From Previous Chat Operations: When you create or retrieve chats, the response typically includes the chat ID.

  • From Teams Admin Center: Chat IDs can sometimes be found in the Teams Admin Center under chat analytics.

Here are a few examples of how you can configure the Chat ID field:

  • Static Chat ID: 19:2da4c29f6d7249c2a7c6b85b476843a7@thread.v2

  • Chat ID from Upstream Snap (Expression): $chatId

  • Chat ID from Previous Teams Operations: $response.chatId

  • Chat ID for Group Chat: 19:8c14075bb84644cfa65ba8b7b3f99cce@thread.v2

  • Chat ID for Direct Message (1:1 Chat): 19:8b914f4c5b4e4db1b8fcfbc31266142e_5031bb20-1dd9-11b2-99a5-63f875ae19ca@unq.gbl.spaces

  • Dynamic Chat ID using conditional logic: $chatType == "group" ? $groupChatId : $directChatId

  • Chat ID from JSON Response: $teamsResponse.value[0].id

Chat ID Format Patterns:

Group chat format:

  • Pattern: 19:<32-character-hex>@thread.v2

  • Example: 19:2da4c29f6d7249c2a7c6b85b476843a7@thread.v2

Direct message format:

  • Pattern: 19:<guid1>_<guid2>@unq.gbl.spaces

  • Example: 19:8b914f4c5b4e4db1b8fcfbc31266142e_5031bb20-1dd9-11b2-99a5-63f875ae19ca@unq.gbl.spaces

Meeting chat format:

  • Pattern: 19:meeting_<meeting-id>@thread.v2

  • Example: 19:meeting_MjQyNjMxNTQtZjY4Mi00NzllLWE3NzYtMDcwYWQzNjg1M2I5@thread.v2

chat-ids-chat-msg.png

Default Value: N/A
Exampleb22e8da4-17c1-45c0-baa9-47aed7344e92

Number of retries

Integer/Expression

Specify the maximum number of attempts to be made to receive a response. 

Default Value0
Example: 2

Retry interval (seconds)

Integer/Expression

Specify the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception.

Default Value1
Example: 5

Snap Execution

 

Dropdown list

Select one of the following three modes in which the Snap executes:

  • Validate & Execute: Performs limited execution of the Snap based on Preview Document Count value in User settings and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.

  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default ValueExecute only
Example: Validate & Execute

Example

Teams message automation

This example pipeline demonstrates how to send an HTML-formatted chat message to a Microsoft Teams group chat. The message contains an image, formatted text with quotes, and various emoji characters displayed in different formats and sizes.

Download this pipeline.

ex-send-chat-ms-pipeline.png

Configure the Send Chat Message Snap to send an HTML-formatted message to a Microsoft Teams group chat. The message includes an embedded image from an external URL, formatted text about WWF's mission with quotes, and multiple emoji characters displayed using both decimal and hexadecimal HTML entity codes with custom font sizing.

ex-send-chat-msg-config.png

On validation, the output provides a preview of the following, allowing you to verify the message configuration before pipeline execution.

ex-send-chat-msg-output.png

You can connect a Mapper Snap after the Send Chat Message Snap to capture and transform the timestamp and other output data for use in downstream operations like updating messages or creating threaded conversations.

On execution, the Snap sends the HTML message to the Microsoft Teams group chat.

ex-send-chat-msg-to-teams-user.png

Downloads

  1. Download and import the pipeline into the SnapLogic application.

  2. Configure Snap accounts, as applicable.

  3. Provide pipeline parameters, as applicable.

 

Snap Pack History


Related Content