"Go to tab" - can't send properties

Hey everyone,

When using “Go to view”, this works great because you can send properties with it.

However, if you use “Go to tab”, you don’t have this option.

Furthermore, if you just click on a tab directly, it navigates there, but you have no way of pulling data from the previous page because you can’t reference it from the dynamic data menu options.

This was all handled before by using custom states, so…

TL;DR: Is there a way to set a global custom state that can hold info as we traverse our app? (I don’t want to use the DB)

Cheers

1 Like

You can use local storage with Local Storage (React Native) Plugin | Bubble

1 Like

Thank you @nocodeventure

I bought your plugin, but can’t seem to reference that local storage once I’m in a different view. I checked out your demo, but it’s all setup on the same view which you could achieve by using regular custom states.

I save data to the local storage element in one view, but as soon as I go to another view, that storage isn’t available.

Am I missing something?

Cheers

You should use the same local storage element on both views.

It doesn’t. Should I DM you about this?

Sent you a dm!

1 Like

The local storage plugin does work across multiple views, as long as you use the same namespace. Give it a try using the link below, we created a test button at the bottom to navigate to a second view.

Link: https://ncv-react-plugins.bubbleapps.io/version-test/api/1.1/mobile/preview?debug_mode=true&preview_view=local_storage

Thank you @nocodeventure

Managed to get it working now.

In case other users wish to use this in lieu of a page-level custom state, here are some steps I think will be helpful in case you get stuck:

  1. Make sure to have a Local Storage element on each view that you want the value to be available.
  2. Make sure the “Namespace” value is the same in each Local Storage element on each view (value doesn’t matter, as long as it’s consistent).
  3. Use the “Save to Storage LocalStorage” action whenever you want to save your data to the Local Storage element.
  4. If you want the value to be available when you land on another view, I setup a “Page is loaded” event and then ran the “Load from Storage LocalStorage” action.
  5. From there, you should be able to access the value dynamically by fetching the “loaded_value” property of the Local Storage element.

Hope that helps!

1 Like

Awesome, here’s an updated doc link as well

1 Like