Mentioning specific users in slack webhook

Hi there,

I have a slack webhook setup right now that, when triggered, it posts to a channel. My action is more or less set up as the following:

{
"text": "<<LOOKUP([_THISROW].[User], Users, Id, SlackName)>>: <<[Doc]>> is ready for you to view"
 }

What i would like to do is be able to tag the user in the channel so they get a specific mention/notification.

Iโ€™ve tried putting the โ€œ@โ€ symbol right before the <<Lookupโ€ฆ>> but that doesnโ€™t trigger the deeper integration for tagging a user, iโ€™m assuming because this is all text. Iโ€™ve also tried putting the @ symbol in the username column in my User table, but that didnโ€™t work either.

Any pointers on setting up so it tags the user would be helpful.

Thanks!
Cory

Solved Solved
0 4 4,871
1 ACCEPTED SOLUTION

I donโ€™t think you can insert mentions that way, but it might detect an email or URL and convert it to a clickable link.

For anything more than plan text, you have to send the message body as a โ€˜blockโ€™.

Simple text message body
"text": "message text..."

Block message body (mixed content, interactions, buttons, etc)

"text": "regular text message.",
    "blocks": [
    	{
    		"type": "section",
    		"text": {
    			"type": "mrkdwn",
    			"text": "markdown text"
    		}
    	},
    	{
    		"type": "section",
    		"block_id": "section567",
    		"text": {
    			"type": "mrkdwn",
    			"text": "*Markdown* message **text**"
    		},
    		"accessory": {
    			"type": "image",
    			"image_url": "https://imageurl.com/image123.jpg",
    			"alt_text": "test image"
    		}
    	},
    	{
    		"type": "section",
    		"block_id": "section789",
    		"fields": [
    			{
    				"type": "mrkdwn",
    				"text": "*test"
    			}
    		]
    	}
    ]

View solution in original post

4 REPLIES 4

I donโ€™t think you can insert mentions that way, but it might detect an email or URL and convert it to a clickable link.

For anything more than plan text, you have to send the message body as a โ€˜blockโ€™.

Simple text message body
"text": "message text..."

Block message body (mixed content, interactions, buttons, etc)

"text": "regular text message.",
    "blocks": [
    	{
    		"type": "section",
    		"text": {
    			"type": "mrkdwn",
    			"text": "markdown text"
    		}
    	},
    	{
    		"type": "section",
    		"block_id": "section567",
    		"text": {
    			"type": "mrkdwn",
    			"text": "*Markdown* message **text**"
    		},
    		"accessory": {
    			"type": "image",
    			"image_url": "https://imageurl.com/image123.jpg",
    			"alt_text": "test image"
    		}
    	},
    	{
    		"type": "section",
    		"block_id": "section789",
    		"fields": [
    			{
    				"type": "mrkdwn",
    				"text": "*test"
    			}
    		]
    	}
    ]

This is extremely helpful, thank you!

Just wanted to share how I did @ mentions using slack webhooks. In your message you need to have <@memberID>. The member id can be found using these instructions. I have the setup as <@<<[_THISROW].[slack_id]>>> to reference the [slack_id] column in my data frame that stores the memberID for that selected user

@Andrew_Caffrey Thank you very much for your input on this! I was finally able to get this working using your technique.

Top Labels in this Space