# How to save List of Options to Local Storage?

**URL:** <https://forum.bubble.io/t/how-to-save-list-of-options-to-local-storage/349168>\
**Category:** Need help\
**Created:** [November 20, 2024, 8:47pm UTC](https://forum.bubble.io/t/how-to-save-list-of-options-to-local-storage/349168 "2024-11-20T20:47:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![james34](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@james34](https://forum.bubble.io/u/james34)\
**Post date:** [November 20, 2024, 8:47pm UTC](https://forum.bubble.io/t/how-to-save-list-of-options-to-local-storage/349168/1 "2024-11-20T20:47:04Z")

</div>

Hi everyone!

I need to save a list of options to local storage, then upon page refresh, return them and save as a state (list).

Can someone help with this?

I can pay if there’s a user here with an Upwork account - We really need this solving.

---

<div class="post-metadata">

**Author:** ![adamhholmes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adamhholmes/32/100510_2.png) [@adamhholmes](https://forum.bubble.io/u/adamhholmes)\
**Post date:** [November 20, 2024, 10:18pm UTC](https://forum.bubble.io/t/how-to-save-list-of-options-to-local-storage/349168/3 "2024-11-20T22:18:02Z")

</div>

There’s no native support for local storage, but it’s easy to run the javascript yourself with the toolbox plugin.

To save an array to local storage you can just use a run JavaScript action to run the following code:

```auto
const myArray = ['Option 1', 'Option 2', 'Option 3', 'Option 4'];
localStorage.setItem('myArrayKey', JSON.stringify(myArray));

```

In your case, it needs to be an array of strings (those being the Option’s Display).

And to retrieve it you can use the expression element (set to output a list of the Option Set Type) with the following code:

```auto
const retrievedArray = JSON.parse(localStorage.getItem('myArray'));
retrievedArray;

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [January 29, 2025, 8:47pm UTC](https://forum.bubble.io/t/how-to-save-list-of-options-to-local-storage/349168/4 "2025-01-29T20:47:28Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
