support with database inserting / removing entry . urgent

Hello, I am currently working on a ’ adopt a family ’ site for the holidays. The focus of page is to allow users ( who are able to create an act) adopt a family , view their wishlist and purchase family those gifts. I have already created form and database for the adopters , so they are able to fill form, and form info is submitted to database.

already created db for families as well . Theres roughly 275 families in db , imported via CSV file.

Goal: I want to be able to have the adopters choose their family…family name gets submitted to adopters db .

  • adopter can then view their assigned family in members page
  • adopted family no longer visible in ’ adopt a family page’
  • families db will also list the adopter name.

I have very little experience with code, but I could see what’s going on with code. Please let me know what would be the most efficient way to do this. Thank you!

Hey Rosa,
I believe you’d be able to find answers to most of your questions in the following API reference link: https://www.wix.com/corvid/reference/wix-data

In more details, in regards to your Goal’s bullets :

  1. Make sure you have a dedicated column in the adopters collection for the purpose of storing the Adopted Family Name. Then, where-ever in your site that Adopters can select a Family, make sure to update that field with the proper info. (look for the update method in the above reference).

  2. You’ll of course need to have some kind of a dedicated element, let’s say a Text element, to show the Family Name. In order to get the value of that Name, you’ll need to either connect the element via data-set , or fetching the data manually via code (more on that can be found under query, in the above reference).

  3. This is an architectural subject, you can achieve this in more than one way. Two options would be to either use the remove method (again, please check the reference above), or to maintain some sort of an indicator field inside the collection, that would flag if the specific family has already been adopted, if yes do not display it in the families list.

  4. I believe same actions as I wrote in the 1st point should take place.

Hope you’ll find this helpful.
Chen

Thank you Chen ! and I would use this one each page for the selections? For the adopt a family page we have a button that says " adopt a family" and once user clicks button we would like for that family to be adopted. Let me know if this is the best way or if we should go about it a different way? .

Hey @remanriquez35381
Not completely sure what you’re asking here - what do you mean by “use this one each page for the selections”?

@chend yes that was confusing. To be clearer, I am wondering if I code below the specific page where the adopter has option to adopt a family or whether I would need to add various pages of code? This is my first site so I’m pretty new to this aspect of it.

@remanriquez35381
In general, the code written below a specific page (in what is call the IDE) is related to the components that appear in that specific page. If you have several pages, and you need to have some kind of functionality that requires code in all of them - you will to write the relevant code for each of them. (more on how to expand functionality to components using code can be found here https://www.wix.com/corvid/reference/$w))

I understand you’re new to this stuff, let me just say that whenever I approach a new project, I always try to address the difficulties I face in baby-steps. Trying to get it “all in once” is confusing, and usually brings more troubles than solutions.
I think that for beginners the most easy way to start is to focus first on the Wix Editor elements, putting everything on the screen and only after adding the code. Then, again - slowly, adding code step by step line by line. Slowly but surly you’ll understand your needs and your specific difficulties better, and when you’ll be able to pin point exactly what the difficulty is - you’d probably have easier time finding the solution.

Hope this somewhat helpful and leading you forward.