Skip to content

Commit 7daf5c8

Browse files
authored
Adds update view on submission docs (#479)
1 parent 977875e commit 7daf5c8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/_basic/listening_modals.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ If a <a href="https://api.slack.com/reference/block-kit/views">view payload</a>
1111

1212
You can access the value of the `input` blocks by accessing the `state` object. `state` contains a `values` object that uses the `block_id` and unique `action_id` to store the input values.
1313

14+
---
15+
16+
##### Update views on submission
17+
18+
To update a view in response to a `view_submission` event, you may pass a `response_action` of type `update` with a newly composed `view` to display in your acknowledgement.
19+
20+
```python
21+
# Update the view on submission
22+
@app.view("view_1")
23+
def handle_submission(ack, body):
24+
ack(response_action="update", view=build_new_view(body))
25+
```
26+
Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions.
1427
Read more about view submissions in our <a href="https://api.slack.com/surfaces/modals/using#interactions">API documentation</a>.
1528

1629
</div>

0 commit comments

Comments
 (0)