(Solved) User settings / best aproach

hi

What would be the best way to manage user settings?
For example, i want to allow users to customise their dashboard, hide specific orders from their shop and so on.
What i think of is , to make lots of fields under user type, on/off. For example hide_canceled_order - yes/no

regards

That’s the approach I will take as well.

Alternatively you could create a new type called Usersettings to hold all the information. And then just add one field on the User type. I guess that would make the User more clean and I can’t see any downside to that.

The thing is that, if i take the second aproach, then i need something like this:
Type= settings

settings can have multiple fields like, hide canceled orders, hide that menu and so on.
But when i go to users account page and turn a setting on/off i cannot do it like: Make changes to CurrentUsers Settings - hide canceled orders - yes/no.

I have tried it but it creates a value every time instead i need to do it like this:

i think it will increase loading time if i will use Do a search for every time i need to apply this condition

or like that




Still there is this Do a search for here, which will slow down everything,right?
If we put all this settings under the user, is much easier i think

I would do like this instead.

So create a new field on the User type. That you can access directly from the current user.

Thats what i did. But the issue is that, you always need to work with “First item”. When you create new setting, when you edit that setting and so on. So, you ll always need to : “Do a search for:curentUser setting: first item”
If i do it as you say (the same i thought) then you get multiple entries for user:


Link to app: https://testy11.bubbleapps.io/version-test/index/sample:user?debug_mode=true
Link to editor: testy11 | Bubble Editor

What do you think Søren? Am i wrong?

I don’t fully understand the problem. Take this as an example - here you don’t do a search, you just access the current user’s settings. But maybe I misunderstood how you wanted to structure the settings data type. If you just continue adding fields for each thing you want to save, I don’t see a need for searching.

The problem is that, if i use “Make changes to settings” for some reason it creates a record every time. It does not make change. You got it? I get a line in database in settings, each time user performs an action. I would like to have only 1 line and keep editing that.

That’s strange. I don’t understand why that happens. Could it be a bug?

Maybe @emmanuel or @NigelG could enlighten us?

Guys,

Is the setting value assigned under the user? Is the user logged in?

Can you share link to editor?

no, it’s different type. but under user we have settings = settings

Yep, the setting value was not assigned under the user. After assigned works as expected

hmmm. how could i automatically assign the setting to a user?

got it now! at sign up, we create the new setting, and assign it to new created user. Thank you

just keep it the same way it is. When the this option is enabled the database will keep updating the same entity. If the values are not the same then it will create it the first time. Don’t store this like this, you can remove that!

Great :slight_smile: