Forum Academy Marketplace Showcase Pricing Features

Clarification and saving data

How would I save data locally?
Like if a person on the site uploads a file, and I store it in a type, is that type global or local to their session?

So like for example if two people are on the site, and I have a file uploader. The two people upload something and I have a page that displays it. I am currently saving data in a Type called “file”. Depending on whoever uploaded the file last, would both users have the same file displayed to them or their own individual one?

I’m just kind of confused on how data works and wonder if I could save things locally particularly to that user’s session.

Hi @sonik every user will see only their session file in this case described

But you need to describe more if you are saving the file as a logged user or just a visitor if you push the file to the page from the database its another thing

Custom states

so in this case. My custom data types here are specific to the current user right? So if another person upload per say a file and add a new item to “File Upload”, it wouldn’t affect someone else’s “File Upload” data set correct? So my current setup is local and what I desire correct?

No. Search the forum and the Bubble reference for “custom states” and use those. You can add a custom state of various types to any Bubble element. Those are stored client-side, and will be unique to each session.

so the only way to save locally / based on current session of user is through custom states that you put onto elements? So would that mean if I have a form, I would have to have a whole bunch of custom states???

Precisely. Another way is to store local data in regular elements that are hidden or grouped in a hidden group. So you could create a hidden image element that stores an image, and do on, or put such elements in a hidden group.

A quick shortcut is to just copy-paste the form as form 2, make it hidden, and save a copy of form 1 to form 2.

so just make an element filled with custom states, but make it not load on the page would be the best choice?

Some people define all custom states on the page itself. For example, if your page is index, index itself can have custom states. That way you don’t need to create more elements. I encourage you to dig in the forum and the Bubble reference on custom states. It will save you time and effort later.

do custom states only work to the page they are on? I’m currently testing them out and can change the color of things on the page the state is on but not if on another page.

Actually can’t I use current user?

You can, but only for fields defined in User.

Correct