How to make a mention to a user in a slack message from Workflow Builder when the username/ID comes from a variable
Asked Answered
K

2

8

I'm trying to make a workflow for my slack team where I have these steps (with workflow builder):

  • Starts when user clicks on the shortcut in a channel
  • Opens a form - we ask many questions, one question has multiple fixed choices
  • Select row from Google Sheets - depending on the answer, we select a row
  • Send a message to a slack channel - Use the value from another column of the same row that contains a slack memberID (or username) to mention the person on the message

I expected the slack message on the channel to have @userHere as a mention (triggering the notifications). However, the message was sent on the channel with @userHere as a plain string i.e. not clickable and it does not trigger a notification.

What I tried:

what I put in the send message step what is saved in the sheet
@variable "user.name"
@variable "U123213"
variable "@user.name"
variable "@U123213"
{{variable}} @user.name

among other attempts, but I never get the mention.

Knorr answered 19/4, 2023 at 19:19 Comment(4)
did you find any workaround?Pushy
Not yet... it seems something simple.. but i can't find a workarount...Knorr
I am looking for the exact same solution. Have you ever find the solution? Any workaround you did?Animate
I think it is still not working - forums.slackcommunity.com/s/question/0D53a000094Qx0uCAC/… They suggested using userId, not name, like <@USER_GROUP_ID> but this is not working for me. Was trying to do that for group <!subteam^user_group_id> and it shows in form perfectly fine, but then it looks like Slack converts it to plain text :/ Don't have any clue how to do that.Rewrite
K
0

If using webhooks, you can add a "Slack user email" variable in the workflow and then add that variable to the "Message text" with Mention (default) option selected.


Webhook settings

Webhook settings


Send a message settings

Send a message settings

Koziol answered 20/2 at 19:16 Comment(0)
O
-3

when posting from the SLACK API I believe the correct code for an @ is to wrap it in angled brackets

<@user_id>

So in the case where you input was of the form

{{variable}}

Then it should translate the variable appropriately.

Outreach answered 28/4, 2023 at 16:52 Comment(1)
I just get {{<@U0452BNJR7V>}} as plain text...Knorr

© 2022 - 2024 — McMap. All rights reserved.