Handling/storing user data

Bubblers,

What’s the best way to handle/save user data? I am building this budget with defined min. and max. as option attributes. Then the user enters the amounts for 9 categories, which are saved in 9 user fields, which the user will continue to edit. At some point I want to permanently save the user’s data, so that means another 9 user fields, and if I want to save a 2nd set then it’s another 9 user fields. Seems like a pretty tedious way to handle/store user data from a coding perspective (plus the 18 option attributes). Is there a better way?

image

Thanks all! :slight_smile:

1 Like

Yes, there’s a better way.

I suggest you add a Budget Category Entry thing in the database (you can name it whatever you want).
You can define the categories (name, default min, default max etc) in an Option Set.

The Budget Category Entry thing should have a user field that references the user it applies to and a field for the Option Set linking to the budget category that it applies to.

With this structure, you can create as many entries for a user as you would like without creating additional fields.

Don’t forget to add privacy rules to the thing if required to secure the entries to the appropriate users (created by user/admins etc).

Hi codably. Thanks for your help!
I have the min and max in an option set, that’s the easy part. I don’t understand the rest, how to have a thing that has a user field? I don’t know how to set that up, sorry.
:slight_smile:

You’re welcome!

  • You’ll need a new Budget Category Entry thing. It should look similar to below:
    7BY807Nw5H

  • To add the user reference field, add a new field of type User as below:

  • The Option Set would have similar attributes as below with each of the budget categories that you require (those listed in your question):

Hi Codably, I’m back.

I got this far with the data types. Now how do I set up the input element to be able to continue to add new data to it?

It’s difficult to answer your question without knowing more details about how you want the app to function.

In the simplest instance, you can create an input form which contains:

  • A dropdown to select the Budget Category
  • An amount number field
  • A Save button

The Save button could be attached to a Workflow which creates a new Thing (Budget Category Entry).

This will allow you to create multiple entries for different budget categories.

Thanks Coda, I appreciate your help!

1 Like