Save User as Key on Data Submission?

Hello Community,

I am trying to populate database records on my website, where users select choices from a series of radio buttons then use a “submit” button. I want this database to store the user’s rsponses in their account (they are members; this site is a members-only page). I can get the form to work in some ways and I can submit data, but I’m extremely confused about several things because it’s not doing what I expect. Ultimately I am trying to make the owner/user as a key field on a form submission. Here are my points of confusion - I would appreciate any help please!

  1. The “title” field in the database is set by default as the main field, but it is not populating. I have also seen examples and wix demos where it did not populate. What is this “title” field and why does it not get populated and why do I need it?

  2. I want to make the “owner” field (the user key who submitted the form) a primary key, since I only want one database record per user. Am I missing something easy here - or do I need to write custom code to do these saves and checks? Or, is there a way I can add my own “user” field and set it to populate automatically based on the user key, or user email, or username? Or would I also have to write code to get the user info then write it to the database? I have been pulling my hair out for hours/days/weeks trying to configure this but it seems impossible without writing custom code - is it?

  3. I have tried setting my database to “Write-Only,” which is the best way to allow first-time users to submit data, which works. However, the problem here is that the user can’t actually see their answers populated back on the next page refresh - everything defaults back to the default selections. I want my users to see their past selection when they log in. I have also tried making my form Read & Write which makes sense to me as what I want - to both display data and insert/update it - however in this case, a new user who does not have any saved data cannot use the form to save any data (the radio buttons on my form are all grayed-out and unusable because it’s not reading any data, since I have it set to read but there is nothing to read). My understanding is that these things are supposed to be easy to set…but this all seems impossible now and I’m feeling in a catch-22 in every way. What do I need to do to make this work?

Thank you for your time!

Have a look at this Wix tutorial about member profile pages.

I know that member profile pages is not what you are after here, however you can use the tutorial as a starting point and make the dynamic pages for this tutorial have anything you want on them, like your user inputs instead.

As each user will be a logged in site member, you use dynamic pages so that the pages are linked to each individual member and the pages are unique to that specific member only.

So in theory when each member goes to their own dynamic page they will first see their own choices of what they already chosen, or if it the first time that they view the page, it will either show no choices or a default choice if you have selected a default choice for your radio buttons for example.

Then the user has the option to leave it as it is or to press on the update button to go to the other dynamic page where the user can update or change anything on your user input form and then when they click on save, the data will then be saved back into your dataset for those pages and the user will be taken back to their main page which will then display any changes or alterations that they have just made.

@givemeawhisky Thank you for the input! I think I’ll give your suggestion a shot - although I wasn’t anticipating changing my whole page structure, that sounds more helpful than anything else I’ve been researching. Much appreciated!