From 1e5ca049a6affe7c215c3d41333ef0da813f0107 Mon Sep 17 00:00:00 2001 From: Sarah Jiang Date: Mon, 27 Sep 2021 10:01:06 -0700 Subject: [PATCH] Adds update view on submission docs --- docs/_basic/listening_modals.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/_basic/listening_modals.md b/docs/_basic/listening_modals.md index 8a429acb2..a0146c453 100644 --- a/docs/_basic/listening_modals.md +++ b/docs/_basic/listening_modals.md @@ -11,6 +11,19 @@ If a view payload 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. +--- + +##### Update views on submission + +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. + +```python +# Update the view on submission +@app.view("view_1") +def handle_submission(ack, body): + ack(response_action="update", view=build_new_view(body)) +``` +Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions. Read more about view submissions in our API documentation.