5

I have a slash command in slack calling into a zapier webhook.

The sample command I've setup is:

/todo [Title] [User]

In Zapier, there is an attribute called text in the incoming webhook that maps [Title] [User] as a string value. The problem is that I want to be able to get access to individual variables and not just a text string representing the entire command.

Is there a way in Slack to split variables such that I can map [Title] to a Title form attribute in the POST command and likewise the [User] to a User attribute?

If not, is it possible to do string parsing / string index in Zapier?

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
Nick
  • 4,002
  • 4
  • 30
  • 41
  • How did you get slack to take those variables? http://stackoverflow.com/q/34234180/843443 – Jeff Dec 11 '15 at 23:28

1 Answers1

3

After reading an article on Zapier for Named Variables, I figured that I had to modify the command format in slack to the following:

/todo title(Item title) assigned(User Name)

Then, Zapier started to show variable names Title and Assigned in the action field.

Nick
  • 4,002
  • 4
  • 30
  • 41
  • I had to do something similar. I think the problem is the "system" doesn't know when the Title ends and when the User begins. So you need some kind of delimiters. In my case I was able to do `/cmd "user" other stuff` – nomadic_squirrel Oct 05 '15 at 20:09