# How to use raise PreventUpdate in multiple outputs

**URL:** <https://community.plotly.com/t/how-to-use-raise-preventupdate-in-multiple-outputs/22077>\
**Category:** Dash Python\
**Created:** [April 9, 2019, 12:47pm UTC](https://community.plotly.com/t/how-to-use-raise-preventupdate-in-multiple-outputs/22077 "2019-04-09T12:47:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivekvs1](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@vivekvs1](https://community.plotly.com/u/vivekvs1)\
**Post date:** [April 9, 2019, 12:47pm UTC](https://community.plotly.com/t/how-to-use-raise-preventupdate-in-multiple-outputs/22077/1 "2019-04-09T12:47:33Z")

</div>

Hi, I have a long callback with multiple outputs (for certain reasons, this is more efficient than multiple single output callbacks). I would like to use `raise PreventUpdate` for some of the outputs. How can I do this? Thanks.

Vivek

---

<div class="post-metadata">

**Author:** ![Damian](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Damian](https://community.plotly.com/u/Damian)\
**Post date:** [April 9, 2019, 2:43pm UTC](https://community.plotly.com/t/how-to-use-raise-preventupdate-in-multiple-outputs/22077/2 "2019-04-09T14:43:33Z")

</div>

> [@vivekvs1](#):
>
> I would like to use `raise PreventUpdate` for some of the outputs. How can I do this?

You can’t currently, you need to take the current state of the props and return that state when you return the outputs. E.g.

```
@app.callback(
    output=[dash.dependencies.Output('foo1', 'bar1'),
            dash.dependencies.Output('foo2', 'bar2')],
    inputs=[dash.dependencies.Input('input-trigger', 'value')],
    state=[dash.dependencies.State('foo1', 'bar1'),
           dash.dependencies.State('foo2', 'bar2')],
)
def some_function(input_trigger, foo1, foo2):
    ...
    if some_condition:
        return some_new_value, foo2
    ...
    if some_other_condition:
        return foo1, some_other_new_value
    ...
    return some_new_value, some_other_new_value

```

However if you’re willing to wait, I believe this partial no update feature is coming in the next version of Dash: [Partial updates by alexcjohnson · Pull Request #680 · plotly/dash · GitHub](https://github.com/plotly/dash/pull/680)

---

<div class="post-metadata">

**Author:** ![vivekvs1](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@vivekvs1](https://community.plotly.com/u/vivekvs1)\
**Post date:** [April 9, 2019, 2:45pm UTC](https://community.plotly.com/t/how-to-use-raise-preventupdate-in-multiple-outputs/22077/3 "2019-04-09T14:45:21Z")

</div>

Wow great! That is going to make a big difference to the performance of my app I believe- since those output functions are triggering so many unnecessary callbacks. Thank you @Damian
