Send Message tutorial

This walkthrough explains how to use a basic Send Message operation using the Slack Trigger and connector.

The Slack trigger is kicked off whenever a new user joins a particular channel which is immediately followed by a welcome message.

The logic is as follows:

  • Set up the Slack trigger to react to a new user joining a channel.

  • Get the said user's details.

  • Respond with an automated message to the channel at large.

The completed workflow looks like this:

Step by step explanation
Copy

1 - User joins channel
Copy

Create a new workflow and select the Slack trigger. Make sure your authentication is set up accordingly.

Set your operation to On Slack event and in your Event input field, choose User joined a channel (public or private).

Be sure to click on the green Enable workflow button at the bottom of the builder. Otherwise your trigger won't respond and your data won't be captured.

Now when a user joins a channel your workflow will activate.

2 - Get user name
Copy

Set your Slack operation to Get user.

Make sure your type selector is set to jsonpath. The icon on the top right corner of your input field will update as a result of this selection change.

Once the workflow output is generated/your workflow is triggered you will be able to jsonpath your User id via the connector-snake

Take a look in your debug panel for more details.

3 - Send message
Copy

Add another Slack connector and set your operation to Send Message.

In your Channel input field you should have an automated dropdown list of options to choose from (as a result of the Slack domain you selected during your authentication).

Below we have included an example of a written message which uses Tray.io's Interpolation method. This is In this case, we have used it to get our message to display the new users name.

INTERPOLATION: When you wish to include JSON generated data within another input/output result, use our Interpolation method as described here.

Bonus step
Copy

As an added extra you could also included a Slack icon to display with you message.

Simply copy and paste an icon from the Slack app itself and drop it in the Icon emoji input field.

Despite the icon appearing as an image when it is copied over the text version will display when pasted. The icon will show as normal once generated.