4 weeks ago
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:
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"
}
]
}
}
Solved! Go to Solution.
4 weeks ago - last edited 4 weeks ago
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.
you can see how I did it initially for one of my use cases before, then i used json parser
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.
4 weeks ago - last edited 4 weeks ago
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.
you can see how I did it initially for one of my use cases before, then i used json parser
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.
4 weeks ago
Again, thank you so much! This worked!