cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How do I parse view_submission values using variables in Workato (Slack modal)?

jarh15
Deputy Chef II
Deputy Chef II

Hi communitiy,

I am in need of help parsing a view submission trigger step in Workato using variables. It's a long view submission output and i need assistance using variables to parse specific parts of it. Can someone please help me understand how they'd parse:

  • "private_metadata": "shhh-its-secret"
  • "This is my example inputted value" and

out of the following view_submission output:

{
"type": "view_submission",
"team": { ... },
"user": { ... },
"view": {
"id": "VNHU13V36",
"type": "modal",
"title": { ... },
"submit": { ... },
"blocks": [ ... ],
"private_metadata": "shhh-its-secret",
"callback_id": "modal-with-inputs",
"state": {
"values": {
"multiline": {
"mlvalue": {
"type": "plain_text_input",
"value": "This is my example inputted value"
}
},
"target_channel": {
"target_select": {
"type": "conversations_select",
"selected_conversation": "C123B12DE"
}
}
}
},
"hash": "156663117.cd33ad1f",
"response_urls": [
{
"block_id": "target_channel",
"action_id": "target_select",
"channel_id": "C123B12DE",
"response_url": "https:\/\/hooks.slack.com\/app\/ABC12312\/1234567890\/A100B100C100d100"
}
]
}
}

1 ACCEPTED SOLUTION

1dheeraj2
Deputy Chef III
Deputy Chef III

Hi @jarh15 , can you try this two things.

First, if you want to use only variables, you need to use functions to extract values, such as "value": "This is my example inputted value", from a nested JSON structure as shown below. Check the data tree and use the keys as per your view_submission payload to reach the value you need.

Additionally, you can use auto-populated data pills to retrieve private_metadata, as shown below.
Screen Shot 2025-05-23 at 13.52.52 PM.png


you can see how I did it initially for one of my use cases before, then i used json parser  

Screen Shot 2025-05-23 at 14.03.12 PM.png

You can consider using json parser to make things easy , as the view_submission trigger is going to be a single receiver for each of your custom modals, you should consider future custom modals as well.

Put an if condition on the modal title, and then inside the if condition, use the parse json function with the entire JSON for the specific view_submission's metadata as a sample JSON document. Since it is mostly going to be the same modal in the future, you can then use each field from the view_submission output as a datapill, as shown below.



Screen Shot 2025-05-23 at 12.21.19 PM.pngScreen Shot 2025-05-23 at 12.21.29 PM.pngScreen Shot 2025-05-23 at 12.24.26 PM.pngScreen Shot 2025-05-23 at 12.24.42 PM.png


View solution in original post

2 REPLIES 2

1dheeraj2
Deputy Chef III
Deputy Chef III

Hi @jarh15 , can you try this two things.

First, if you want to use only variables, you need to use functions to extract values, such as "value": "This is my example inputted value", from a nested JSON structure as shown below. Check the data tree and use the keys as per your view_submission payload to reach the value you need.

Additionally, you can use auto-populated data pills to retrieve private_metadata, as shown below.
Screen Shot 2025-05-23 at 13.52.52 PM.png


you can see how I did it initially for one of my use cases before, then i used json parser  

Screen Shot 2025-05-23 at 14.03.12 PM.png

You can consider using json parser to make things easy , as the view_submission trigger is going to be a single receiver for each of your custom modals, you should consider future custom modals as well.

Put an if condition on the modal title, and then inside the if condition, use the parse json function with the entire JSON for the specific view_submission's metadata as a sample JSON document. Since it is mostly going to be the same modal in the future, you can then use each field from the view_submission output as a datapill, as shown below.



Screen Shot 2025-05-23 at 12.21.19 PM.pngScreen Shot 2025-05-23 at 12.21.29 PM.pngScreen Shot 2025-05-23 at 12.24.26 PM.pngScreen Shot 2025-05-23 at 12.24.42 PM.png


Again, thank you so much! This worked!