Skip to content

Commit

Permalink
Adds update view on submission docs
Browse files Browse the repository at this point in the history
  • Loading branch information
srajiang committed Sep 27, 2021
1 parent 4e0709f commit 1e5ca04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/_basic/listening_modals.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ If a <a href="https://api.slack.com/reference/block-kit/views">view payload</a>

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 <a href="https://api.slack.com/surfaces/modals/using#interactions">API documentation</a>.

</div>
Expand Down

0 comments on commit 1e5ca04

Please sign in to comment.