Best answer

Send Slack Message with multiple @mentions

  • 11 February 2023
  • 5 replies
  • 599 views

I have a comma separated string of email addresses which can be any number of addresses, and I want to:

  1. For each of them get the user id by Email
  2. Use the id for each and make an @mention for each of them in the same slack message and send to slack.

I’m not sure if this is possible without being extremely hacky.  I have this working for one user, but can’t seem to find how to add for multiple users.  Anyone have any thoughts?  Thanks

icon

Best answer by Troy Tessalone 13 February 2023, 21:56

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +14

Hi @randyperrone 

Good question.

To loop thru the list you can use the Looping app: https://zapier.com/apps/looping/help

You may need to use Storage to aggregate all the @mentions: https://zapier.com/apps/storage/help

Hi @randyperrone 

Good question.

To loop thru the list you can use the Looping app: https://zapier.com/apps/looping/help

You may need to use Storage to aggregate all the @mentions: https://zapier.com/apps/storage/help

Thanks for your reply! I think the biggest issue is getting the message correct to send to slack once I have all of the id’s ready.  I’m using Send Channel Message in Slack and I know slack mentions are formatted as such <@id> but how to add in any number of those in the text box one after another?  Thanks again!

Userlevel 7
Badge +14

@randyperrone 

We’d need more context about how your Zap steps are configured in order to evaluate and advise, thanks.

Please provide screenshots.

I can’t share the screenshots due to privacy.  I guess more precisely what I’m asking is if there is a way to loop through line items or comma separated text and add text to it.  So say I have apple, orange, pear and want it to loop through and add <@ at the beginning and > at the end so it looks like: <@apple>, <@orange>, <@pear> is that possible?  That would solve the issue.  Thanks!  

Userlevel 7
Badge +14

@randyperrone 

You can redact sensitive info in screenshots if needed.

 

Try using Formatter > Utilities > Line Items to Text

 

A Code step can be used: