Modeling enumerated types with WIX database

How can I models enumerated types with Wix dataset collections? example:

  • I have a class table named “Artisan”: I need to create field “Etat (statute)”, it takes two values ('professional ‘particular’) and those values have required some informations in my registration form example ;
  • For status ‘Professional’: I need to fill field named enterprise name + enterprise statute + address, etc…
  • For statute ‘Particulier’: I need to fill field named responsible function + service activity +… etc

So how can I do that with WIX dataset collections ??

Thanks for your help

Hi,

that’s a nice case.

I would model a collection with all of those fields. And then you have two choices to model the UI:

  1. Build two different forms for the two statues and direct user to appropriate form based on his selection.

Basically user flow being:

  1. Fill in common details
  2. Select statue
  3. Click Next (on next you save the partial details and direct user to the second part of the form where he is actually continuing to edit the same item)
  4. User fills in the specific details and by clicking the last Save / Register button updates the item with remaining details.

The idea rests on building two Dynamic Pages for each of the continued forms (Professional and Particulier) and setting update collection permission to Site Member Author, so only those who started the form can continue filling it.

  1. Hide and show elements based on his selection.

This makes it all into one page, but might be a bit more complicated to model visually.

I hope this gets you on the right track. Don’t hesitate to continue the discussion if you need more details. Have fun Wix Coding!

Thanks for your help Giedrius, but I still have some questions about my dataset collections structure, how I’m going to create my fields, like I said I have many others fields based on (professional / particular).
So how I create my table exactly: All the field in the same table dataset “Artisan” or I’m going to create two different tables for those statues and create a referenced key to my table “Artisan”?

If you will be using the elements in common tables, list, etc. it is best to go with one collection and add all the fields there.

thank you for your help Giedrius