How to respond to Modal's view_submission events
See original GitHub issueDescription
The documentation mentions in several places (1, 2, 3) that when a modal is submitted, you get a view_submission
payload. But I can’t find anything on how you get the payload - it doesn’t seem to be an app.event()
or app.action()
based one. I can’t find any example code either.
I’ve tried tons of things like:
app.event('view_submission', async (everything: any) => {
everything.ack();
console.log("I'm here");
});
But the callback never triggers. I always get a
[ERROR] bolt-app An incoming event was not acknowledged within 3 seconds. Ensure that the ack() argument is called in a listener.
Stranger still, the Events API doesn’t contain anything about view_submission either, but the Error confirms it is an event.
So my question is - How are you supposed to respond to a Modal submit using Bolt?
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I respond to a modal submission event with a message ...
I'm using Bolt JS SDK. I can't find a clear answer to this in the documentation. Maybe it's somehow possible via "ack" method...
Read more >Using modals in Slack apps
Close the current view. If your app responds to a view_submission event with a basic acknowledgment response — an HTTP 200 response —...
Read more >Responding to slack view_submission event with error object
I use ASP.NET Core 2.1 to build integration with Slack Here is my modal in json format.
Read more >Modals - discord.js Guide
Modal submissions can be collected within the scope of the interaction that showed it by utilising an InteractionCollector open in new window, ...
Read more >Modals | Slack SDK for Java
Respond to the Slack API server with 200 OK as an acknowledgment. "view_submission" requests. When a modal view is submitted, you'll receive a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
also ran into this. would appreciate it if it was part of javascript bolt docs (or if i missed it, more prominently shown?)
THANK YOU!!! The
callback_id
was the missing piece. For future readers, it’s needed in the first level of the view JSON, i.e. your JSON looks like this:Then you can respond to it with: