Slack URL link to modal view

Hi there! I am using the Slack pack to send messages to a channel via automation when a row meets a certain criteria. My goal is to create a link to open that row directly into modal view.

However, the slack link breaks (i.e., it is rendered literally as text instead of a URL) when it reaches the &view=modal part of the the link. This is because Slack uses ampersands as special control characters, so they recommend using the HTML form of the character: &. However, this still breaks the link.

Has anyone been able to send a slack message that links to a modal view?

Here is the formula I am using to build the slack message body:

Format(
  "Link to the request <{1}|{2}> has been marked as *{3}*.",
  concatenate(thisRow.[Step 1 Result].ObjectLink(), "&amp;view=modal"),
  thisRow.[Step 1 Result].Description,
  thisRow.[Step 1 Result].Status
)

Thanks in advance!

Will

Hi @Will_Misslin,

Great question. I would try editing the object link, first to see if that corrects it. I would add the “modal=true” tag to the actual link. You should be able to create this with the Concatenate() formula if needed, but that should allow them to click a “link” and have it take them to the modal view within the doc.

It can get a little wonky when trying to decide if it’s “modal=true” or using the “&amp:view=modal” when using packs.

Let us know if that helps with the pushing of the slack message!

1 Like

Thanks for the response @Dan_Demers!

It sounds like we are both thinking in the same direction. I have tried the “usual” way and using Slack’s encoding (see below) and both result in the link breaking in Slack, so as you suggested, this is probably some wonkiness that is happening inside the Slack pack.

Short of there being another way to link to the modal view without relying on a url parameter, sounds like I would need to pursue this with whoever maintains the Slack pack. Any chance you could point me in the right direction?

Thanks!


The “usual” way:

Format(
  "Link to the request <{1}|{2}> has been marked as *{3}*.",
  concatenate(thisRow.[Step 1 Result].ObjectLink(), "&view=modal"),
  thisRow.[Step 1 Result].Description,
  thisRow.[Step 1 Result].Status
)

With Slack’s encoding:

Format(
  "Link to the request <{1}|{2}> has been marked as *{3}*.",
  concatenate(thisRow.[Step 1 Result].ObjectLink(), "&amp;view=modal"),
  thisRow.[Step 1 Result].Description,
  thisRow.[Step 1 Result].Status
)

Hey @Will_Misslin,

Oddly enough it’s us! (haha) I think the best course of action would be to open up a support ticket inside your doc and our support team will help get some additional eyes on this and see what we can do!

Best,
Dan

1 Like

Hi Will, I’m an engineer on the Packs team. Sorry for the hassle with this. The ampersand isn’t the problem, what’s happening is that ObjectLink() outputs an entire link object, not just a raw text string. Putting .ToText() after the ObjectLink() should fix it, no special encoding of the ampersand required. Here’s a test I just ran and got a link on slack with view=modal.
Screen Shot 2023-03-06 at 12.08.29 PM

1 Like

Thanks for the response @Patrick_Barry and I really appreciate you pointing me in the right direction.

Working as expected now!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.