# How to save a textbox value for later use

**URL:** <https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172>\
**Category:** General\
**Created:** [30 July 2023 20:59 UTC](https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172 "2023-07-30T20:59:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)\
**Post date:** [30 July 2023 20:59 UTC](https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172/1 "2023-07-30T20:59:41Z")

</div>

I want to be able to store a value that is updated in a text box every second, so that if I redeploy it will be able to start from that value instead of zero.

---

<div class="post-metadata">

**Author:** ![tree-frog](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tree-frog/32/89303_2.png) [@tree-frog](https://discourse.nodered.org/u/tree-frog)\
**Post date:** [30 July 2023 21:16 UTC](https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172/2 "2023-07-30T21:16:40Z")

</div>

Set Persistance on flow or global variables. Use an inject set for first pass only to push the saved, persistent value to your desired message.

---

<div class="post-metadata">

**Author:** ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)\
**Post date:** [30 July 2023 21:23 UTC](https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172/3 "2023-07-30T21:23:12Z")

</div>

How do i set persistence?

---

<div class="post-metadata">

**Author:** ![tree-frog](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tree-frog/32/89303_2.png) [@tree-frog](https://discourse.nodered.org/u/tree-frog)\
**Post date:** [30 July 2023 21:39 UTC](https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172/4 "2023-07-30T21:39:14Z")

</div>

when you run the node-red command it will show you your file locations. Details are found in your  
settings.js file.

```auto
30 Jul 16:41:08 - [info] Settings file : /home/myname/.node-red/settings.js
30 Jul 16:41:08 - [info] Context store : 'default' [module=memory]
30 Jul 16:41:08 - [info] User directory : /home/myname/.node-red
30 Jul 16:41:08 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Jul 16:41:08 - [info] Flows file : /home/myname/.node-red/flows.json
30 Jul 16:41:08 - [info] Server now running at http://127.0.0.1:1880/

```

Then in the Settings file content. search "Content Storage"

```auto
    /** Context Storage
     * The following property can be used to enable context storage. The configuration
     * provided here will enable file-based context that flushes to disk every 30 seconds.
     * Refer to the documentation for further options: https://nodered.org/docs/api/context/
     */
    //contextStorage: {
    // default: {
    // module:"localfilesystem"
    // },
    //},

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 September 2023 21:40 UTC](https://discourse.nodered.org/t/how-to-save-a-textbox-value-for-later-use/80172/5 "2023-09-28T21:40:07Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
