# Persistence in dash inputs

**URL:** <https://community.plotly.com/t/persistence-in-dash-inputs/77021>\
**Category:** Dash Python\
**Created:** [July 19, 2023, 9:46pm UTC](https://community.plotly.com/t/persistence-in-dash-inputs/77021 "2023-07-19T21:46:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cvalero](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/cvalero/32/16563_2.png) [@cvalero](https://community.plotly.com/u/cvalero)\
**Post date:** [July 19, 2023, 9:46pm UTC](https://community.plotly.com/t/persistence-in-dash-inputs/77021/1 "2023-07-19T21:46:30Z")

</div>

Hi,

I have a dash app with persistence in its inputs enabled (persistence\_type=‘session’). When I fill in the inputs by hand persistency works correctly, but if I fill the values of an input as the output of a callback function, persistency does not work. That is, when refreshing the browser the values in the input fields disappear.

Any ideas?

```
Thank you!!!

```

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [July 19, 2023, 11:42pm UTC](https://community.plotly.com/t/persistence-in-dash-inputs/77021/2 "2023-07-19T23:42:44Z")

</div>

Hi @cvalero

This seems to be per design that persistence is only for user inputs rather than those set in a callback.  
You can find a discussion and some workarounds here:

> <https://github.com/plotly/dash/issues/1252#issuecomment-914608830>
>
> with \`dash==1.12.0\` (haven't tested old versions) and \`persistence\_type='session…'\`:
> setting a \`dcc.dropdown\`'s \`value\` prop programatically, will update the GUI and callbacks alright, but the resulting persistence storage value (browser dev console) behaves very buggy. 
> some observations:
> 1. When setting the value for the first time (no persisted value yet), it would not appear in the storage list at all.
> - (re)setting it manually in the GUI comes up with a scrambled list containing both the manually set value (\`T\`) and the programatically set value (\`null\`): \`\["T",null\]\`
> - the issue is only to be resolved when refreshing the page, deleting the storage entry is not sufficient
> 2. When having set the value in the GUI first, and then repeating the process, the value disappears with the same result
> 3. the persistence entry will keep the two items list until page refresh, even when clearing the dropdown: \`\[null,null\]\`
> 4. the programatically set values are not recalled upon page refresh
> 5. this goes for both \`multi=True\` and \`False\`
> 
> Expected behaviour:
> There should only be one item in the list at all times: \`\[\["T"\]\]\` or \`\[\[null\]\]\`
> 
> I can run more tests if required.

---

<div class="post-metadata">

**Author:** ![cvalero](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/cvalero/32/16563_2.png) [@cvalero](https://community.plotly.com/u/cvalero)\
**Post date:** [July 20, 2023, 12:33am UTC](https://community.plotly.com/t/persistence-in-dash-inputs/77021/3 "2023-07-20T00:33:44Z")

</div>

Thanks Ann Marie!
