# Noob Storage Question

**URL:** <https://forums.fusetools.com/t/noob-storage-question/4397>\
**Category:** How-to Discussions\
**Created:** [July 12, 2017, 5:21pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397 "2017-07-12T17:21:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaac\_Strong](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Isaac\_Strong](https://forums.fusetools.com/u/Isaac_Strong)\
**Post date:** [July 12, 2017, 5:21pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/1 "2017-07-12T17:21:11Z")

</div>

Hi I am creating a super simple app for my parents and I’m quite new to this. I am only experienced in Mat lab and a little C. Anyways I am basically modifying the tutorial hikr app and I want the changes to be persistent, how do I accomplish that? I dont want to run it on a backend server, just local data persistence. It’ll only be text and maybe a photo in the future so there is no concern for storage space limitation.

Any help would be great thanks!

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 12, 2017, 6:01pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/2 "2017-07-12T18:01:14Z")

</div>

Hi Isaac,

you should take a look at [FileSystem module](https://www.fusetools.com/docs/fuse/filesystem/filesystemmodule). I suggest storing data in JSON format.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Isaac\_Strong](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Isaac\_Strong](https://forums.fusetools.com/u/Isaac_Strong)\
**Post date:** [July 12, 2017, 6:29pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/3 "2017-07-12T18:29:30Z")

</div>

I have been looking through there but I am unsure how to implement it. If I was to literally use this for the backend on the hikr tutorial, how would I save variable values there to then be called on later?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 12, 2017, 6:32pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/4 "2017-07-12T18:32:37Z")

</div>

The example on that page I linked shows how to use it for both writing and reading a file. What’s the issue?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 12, 2017, 6:39pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/5 "2017-07-12T18:39:26Z")

</div>

There is also an example for [using Storage library](https://github.com/fusetools/fuse-samples/tree/master/Samples/Storage), which you could easily change to use FileSystem instead. Hope this helps!

---

<div class="post-metadata">

**Author:** ![Isaac\_Strong](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Isaac\_Strong](https://forums.fusetools.com/u/Isaac_Strong)\
**Post date:** [July 12, 2017, 7:55pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/6 "2017-07-12T19:55:20Z")

</div>

Thank you for the help! I am confused where I should implement this function, do I use it in the Backend.js? or on the actual Pages where variables are being written/read? Does this create a file or does the associated file need to be created before hand and exported with the app?

This is my first app so I am REALLY new to this.

Than you again for the help you’ve already given to me. I am going to try to implement in the Backend.js file and work from there

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 12, 2017, 8:23pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/7 "2017-07-12T20:23:05Z")

</div>

In the case of hikr example, it might indeed be best to implement a `FileSystem` abstraction in `Backend.js`, since that’s your _model_ where the data resides. The pages should only be _viewmodels_ that transpose the data from _model_ to _view_, and do not care about where the data ends up being stored, or how it looks like on the screen.

However, if you’re REALLY new to making apps or coding in general, you should probably follow the [Tutorial](https://www.fusetools.com/docs/tutorial/tutorial) very carefully and maybe learn some JavaScript on the side.

The `FileSystem.writeTextToFile()` function creates the file if it doesn’t exist, but you also have other functions, such as `exists()` that you can use, depending on what you need to achieve. See the [FileSystem Interface](https://www.fusetools.com/docs/fuse/filesystem/filesystemmodule#section-table-of-contents) for details.

---

<div class="post-metadata">

**Author:** ![Isaac\_Strong](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Isaac\_Strong](https://forums.fusetools.com/u/Isaac_Strong)\
**Post date:** [July 13, 2017, 5:42am UTC](https://forums.fusetools.com/t/noob-storage-question/4397/8 "2017-07-13T05:42:04Z")

</div>

This has helped immensely thank you!

---

<div class="post-metadata">

**Author:** ![Isaac\_Strong](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Isaac\_Strong](https://forums.fusetools.com/u/Isaac_Strong)\
**Post date:** [July 13, 2017, 10:24pm UTC](https://forums.fusetools.com/t/noob-storage-question/4397/9 "2017-07-13T22:24:46Z")

</div>

Okay I implemented this strategy but the data entered in the app is not persistent still. I think it may be because my variable ‘pinfos’ and ‘vehicles’ are not observable? Also I came across this out discussion - [https://www.fusetools.com/community/forums/howto\_discussions/how\_do\_i\_each\_an\_observable\_array?page=1](https://www.fusetools.com/community/forums/howto_discussions/how_do_i_each_an_observable_array?page=1) - could that have something to do with my problem?

My thought process is that on start-up the variables recieve their values that i have given. Then a storage file is read and if there is data within it the variables are changed to what is stored. If no storage file is found, one is created and the variables (with default values) are stored in the file. When the variables are updated by the user, the functions updateVehicles and updatePinfos will write the new values of the variables to the storage file. Does this flow not work or is my code not accomplishing the steps in the correct order? Fuse is not giving me any error codes.

Here is the link to my current project on github

> **[Hotschmoe/fusesasi](https://github.com/Hotschmoe/fusesasi)**
>
> fusesasi - App made with FuseTools
