Slack: How to create a dynamic dropdown message menu using items from array data pill
Hi, I'm trying to create a dynamic dropdown menu in Slack. I would like a dropdown menu containing all the categories currently in use in our Service Now instance. I could easily create the dropdown menu however, I would like workato to pull the categories from snow and create the dropdown menu with them. The reason for this is that if we ever have to add/remove a category, then we wouldn't have to change the recipe as it would update automatically the next time it is triggered.
Best Answer
A
Amanda Wong
said
almost 7 years ago
This should be possible as long as the format of the pills are set up according to the JSON format required.
For instance, you can work with list data pills to achieve that. You can use formula mode (pluck, format_map) to format the options according to the specified JSON format.
The formula in the above screenshot would result in 2 options for the message menu as follows:
As seen in Slack:
format_map works with list data pills. So in the formula example that I showed, the array contains fields with api names "name" and "age" and format_map refers to these API names to work directly with the data using %{name} and %{age} to place them in the format with labels "title" and "command" -- (case sensitive).
*Formula has been revised to simplify since first post.
Answer
Amanda Wong
said
almost 7 years ago
This should be possible as long as the format of the pills are set up according to the JSON format required.
For instance, you can work with list data pills to achieve that. You can use formula mode (pluck, format_map) to format the options according to the specified JSON format.
The formula in the above screenshot would result in 2 options for the message menu as follows:
As seen in Slack:
format_map works with list data pills. So in the formula example that I showed, the array contains fields with api names "name" and "age" and format_map refers to these API names to work directly with the data using %{name} and %{age} to place them in the format with labels "title" and "command" -- (case sensitive).
Saul Macht
Slack: How to create a dynamic dropdown message menu using items from array data pill
Hi, I'm trying to create a dynamic dropdown menu in Slack. I would like a dropdown menu containing all the categories currently in use in our Service Now instance. I could easily create the dropdown menu however, I would like workato to pull the categories from snow and create the dropdown menu with them. The reason for this is that if we ever have to add/remove a category, then we wouldn't have to change the recipe as it would update automatically the next time it is triggered.
This should be possible as long as the format of the pills are set up according to the JSON format required.
For instance, you can work with list data pills to achieve that. You can use formula mode (pluck, format_map) to format the options according to the specified JSON format.
The formula in the above screenshot would result in 2 options for the message menu as follows:
As seen in Slack:
format_map works with list data pills. So in the formula example that I showed, the array contains fields with api names "name" and "age" and format_map refers to these API names to work directly with the data using %{name} and %{age} to place them in the format with labels "title" and "command" -- (case sensitive).
Learn more about format_map here: http://docs.workato.com/formulas/array-list-formulas.html#formatmap
You can find the api names of your data from the job reports.
Text version of formula as seen in screenshot above:
*Formula has been revised to simplify since first post.
Amanda Wong
This should be possible as long as the format of the pills are set up according to the JSON format required.
For instance, you can work with list data pills to achieve that. You can use formula mode (pluck, format_map) to format the options according to the specified JSON format.
The formula in the above screenshot would result in 2 options for the message menu as follows:
As seen in Slack:
format_map works with list data pills. So in the formula example that I showed, the array contains fields with api names "name" and "age" and format_map refers to these API names to work directly with the data using %{name} and %{age} to place them in the format with labels "title" and "command" -- (case sensitive).
Learn more about format_map here: http://docs.workato.com/formulas/array-list-formulas.html#formatmap
You can find the api names of your data from the job reports.
Text version of formula as seen in screenshot above:
*Formula has been revised to simplify since first post.
Siba Prasad Patro
Hi Saul,
I have similar requirements, could you please help me with it? How did you sync it with Servicenow?