# I want to pass the output came from previous callback as input of the app.callback()

**URL:** <https://community.plotly.com/t/i-want-to-pass-the-output-came-from-previous-callback-as-input-of-the-app-callback/76201>\
**Category:** Dash Python\
**Created:** [June 19, 2023, 11:18am UTC](https://community.plotly.com/t/i-want-to-pass-the-output-came-from-previous-callback-as-input-of-the-app-callback/76201 "2023-06-19T11:18:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishnateja](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@krishnateja](https://community.plotly.com/u/krishnateja)\
**Post date:** [June 19, 2023, 11:18am UTC](https://community.plotly.com/t/i-want-to-pass-the-output-came-from-previous-callback-as-input-of-the-app-callback/76201/1 "2023-06-19T11:18:32Z")

</div>

```auto
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash( __name__ )

app.layout = html.Div(
    [
        dcc.Input(id='input-field', type='text', value=''),
        html.Button('Submit', id='submit-button', n_clicks=0),
        html.Div(id='output-div')
    ]
)

@app.callback(
    Output('output-div', 'children'),
    Input('submit-button', 'n_clicks'),
    State('input-field', 'value')
)
def process_input(n_clicks, input_value):
    # Perform some operations with the input value
    result = do_something(input_value)
    return result

@app.callback(
    Output('output-div', process_input()),
    Input('output-div', 'children')
)
def process_output(input_value):
    # Use the output of the previous callback as input for this callback
    processed_result = do_something_else(input_value)
    return processed_result

def do_something(value):
    # Perform some operations with the input value
    return value.upper()

def do_something_else(value):
    # Perform some other operations with the input value
    return f"Processed: {value}"

if __name__ == ' __main__':
    app.run_server(debug=True)

```

I want to pass the output came from previous callback as input of the app.callback() funtion like I’m writing example under the question

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [June 19, 2023, 11:30am UTC](https://community.plotly.com/t/i-want-to-pass-the-output-came-from-previous-callback-as-input-of-the-app-callback/76201/2 "2023-06-19T11:30:06Z")

</div>

You could write your output of the first callback into a `dcc.Store()` and use the `State()` of the `dcc.Store()` in your second callback.

---

<div class="post-metadata">

**Author:** ![krishnateja](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@krishnateja](https://community.plotly.com/u/krishnateja)\
**Post date:** [June 19, 2023, 12:02pm UTC](https://community.plotly.com/t/i-want-to-pass-the-output-came-from-previous-callback-as-input-of-the-app-callback/76201/3 "2023-06-19T12:02:28Z")

</div>

I want to use it in the output of callback

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [June 19, 2023, 12:32pm UTC](https://community.plotly.com/t/i-want-to-pass-the-output-came-from-previous-callback-as-input-of-the-app-callback/76201/4 "2023-06-19T12:32:56Z")

</div>

I don’t understand this, sorry
