I am thinking of creating a config table to hold various values for the web app making it easier to change things globally later (and the client to change them, too) so I have a simple table containing just a couple of fields - configName and configValue. I will then store things like…
Thanks Ben. Yes, that’s one way but it means editing the database structure when adding new settings. I want to create something that can easily grow just by adding records.
Thanks Ben. I did wonder about that but I’m not sure it will give many benefits from @ben’s suggestion.
To my mind, having a table with multiple records is the easiest to maintain and getting that data into an array is the easiest to then use. But my experience with arrays isn’t too great!
You could just create a single query in server connect to get all the terms (value pairs), and then probably cache them. (I'm not sure if this is answering your question.)
I want to get values which will mostly be used in server connect actions (like sending a notification to an admin email when someone uploads something) but I may also use them in the front end.
The JSON data type support with Wappler is quite flexible. You would have an entry for each customer/user that needs a config and the JSON contains all the relevant fields you want, already in keyed objects. If you want to add an option, simply add it to the UI in Database Manager and it will be usable in queries/data picker - no client-side manipulation required. The database is not being changed each time, you are just specifying the structure of what is stored in an already present field.
Jon, if you don’t have any reason to not go with JSON you should. If at some point you need to nest data you will be grateful for not having gone with arrays over json.
I’ve created a new MSSQL column with array text in it.
Then I went to DB manager and changed the datatype on that field to JSON/Array.
(as you reference in this post)
But that column still has a “A” Text icon whenever I see my ServerConnect structure as I’m trying to select fields.
Am I supposed to do something to update all the references to this manually-changed column?