Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use variables within URLs of slack workflows actions?

Tags:

slack

I'm setting up a workflow that takes in a text variable I'd like to use in a later link.

For example, I ask for "Api Name", and then want to send a message that both references the api name as well as constructs a url (e.g. http://swagger.io/docs/"Api Name")

The problem I encounter is the links come up in plaintext if I just try to include that url as plaintext example as above. If I use the editor to try and add a link, the variable is not available.

My next thought was to try and edit the workflow json to supply some markdown in there, but it looks like the richtext is constructed from a series of elements. A link looks like this:

{
    "type": "link",
    "url": "https://swagger.io/collections/",
    "text": "(Link)"
},

And a token looks like this:

{
    "type": "workflowtoken",
    "id": "<some uuid>==user",
    "property": "",
    "data_type": "user",
    "style": null
},

If I merely make the link plaintext and try to append the variable after the prefix I get something like this:

{
    "type": "text",
    "text": "https://swagger.io/thing/",
    "style": {
        "unlink": true
    }
},
{
    "type": "workflowtoken",
    "id": "<uuid>==text",
    "property": "",
    "data_type": "text",
    "style": null
},

So maybe if we knew all the values "type" could be that would help?

Not sure where to go from here. Anyone have any suggestions?

like image 864
ehossack Avatar asked Aug 27 '20 19:08

ehossack


People also ask

How do you add variables in Slack workflow?

Tip: If you need to add, remove, or modify variables at any point, open your workflow in Workflow Builder. Then, click Edit next to Webhook to make your changes. You'll also need to make sure any changes to variables are reflected in the external service your webhook request is sent from.

How does Slack calculate workflows?

View activity for a workflowFrom your desktop, click your workspace name in the top left. Select Tools from the menu, then click Workflow Builder. From the Your Workflows tab, click on a workflow to open it.

How do I navigate to Slack workflow builder?

Open the menu in a particular Slack workspace, scroll down to Tools, and select Workflow Builder to launch the function.

What is slack workflow builder?

A workflow is a multi-step process, where some of the steps are automated by Slack. Workflows are available for end-users in various locations in Slack. Workflow Builder offers a simple set of tools to create workflows. There's no code involved, so anyone can create workflows by creating a flow of workflow steps.

What happens if I Unpublish a slack workflow?

Unpublishing a workflow will make it temporarily unavailable, allowing you to update and re-publish it when the new changes are ready. Permanently remove your workflow from Slack.

How do I set up a workflow in workflow builder?

Follow the steps below to open Workflow Builder and set up your workflow. From your desktop, click your workspace name in the top left. Select Tools from the menu. Select Workflow Builder, which will open in a new window. From Workflow Builder, click Create in the top right. Enter a name for your workflow, then click Next .

Can I share steps from apps in workflow builder?

These steps from apps can be shared and used by anyone in Workflow Builder. Use steps from apps to send data to external services, create tasks in project management systems, or update tickets. Follow our guide to learn how to build your own steps, custom tailored to your organization’s needs.


Video Answer


1 Answers

Here is an answer from Slack Support Service:

We don't yet support Workflow variables outputted in links, I'm afraid.

This is feedback we hear quite a bit so hopefully it's the something the team will consider implementing in the future.

like image 176
Alexey Balkanskiy Avatar answered Sep 17 '22 15:09

Alexey Balkanskiy