Dropdown field type

I am trying to figure out what the field type for a drop down menu should be used for a new data type.

I have a drop down to choose Vanilla or Chocolate Ice Cream. How do I set up saved data from drop down to DB?

DB:

Data Type > New Type >Create New Field Type> Field Name"Ice Cream Flavors"> ??? Do I go with text or Yes/No or something else.

1 Like

I typically default to text fields, especially for more abstract things in my database.

Things I’m positive the format won’t change in the future (phone number, address, user email) I’ll use the associated field type for.

yes/no things are more like “Chocolate”, where the form would be along the lines of “Click here if you love chocolate”.

Again though, it’s up to you, I think it’s very much a “do what makes sense to you” type scenario.

If I misunderstood your question, let me know

Awesome, thanks for the reply. I am not positive what you mean [quote=“skylershelton, post:2, topic:8827”]
I’ll use the associated field type for.
[/quote]

The associated field type = ?

I should of also asked about check boxes. Is there a best practice to link/relate them to the DB?

Let’s say there are check boxes so the user can check box an additional purchase, i.e. “soda”. I don’t understand if this would dynamic. It seems it would be, but is yes/no or just text. hopefully that makes some sort of sense.

Data Type
Field Name
Field Type

So like

Thing: User
Field Name: Phone Number
Field Type: US Phone Number

I’m sure the format of US phone’s won’t change, so I go ahead and use that field type.

Like I said though, I usually default to text field types, unless I have a specific need for a different type.

As far as checkboxes are concerned, they are a type of input, so yes you’ll want to use them to create or modify data.

Right, that’s a good use case for a checkbox. In this case, I wouldn’t use a boolean (yes/no) field type though.

Let me back up though. I think the pain point here isn’t which field type to use for this rather it’s the underlying architecture or design of your database.

Gaby has an excellent write up on designing a database in one of her previous newsletters. She walks through building a database for a hair salon. Have you read it? I can dig up a link for it if you haven’t.

Thanks man. I do have that newsletter but I forgot about it. Will read and give a go. I really need to sign up for her coaching, she’s awesome.

1 Like

That newsletter from Gaby is from 10/04/2016 - Structure, Save, Search: 3 Database Essentials.
Everyone go get a copy now and sign her up to be your coach :sunglasses:

1 Like

Still having trouble with the checkbox concept.

If I have a check box selections, how do they reflect as field type?

Seems like field name would be “extra sprinkles” and if it is checked then an additional cost on check out would be added. But if not checked then no effect on total cost.

So, it seems like field type would be yes/no. Or, is this determined in the workflow - that when this button is clicked , etc… Any clarification would be appreciated from those in the know.

@skylershelton @proust007 Thanks for the shoutout! I’m glad I’ve been able to help :slight_smile:

Re: checkbox… You can achieve this a few different ways. 1 way is to have workflows with conditions. For example:

When button is clicked and checkbox “extra sprinkles” is checked > create bill > total = base price + sprinkles price

Or change the total every time the checkbox changes…

When checkbox value is changed and is checked > make change to bill > total = xyz

When checkbox value is changed and is not checked > make change to bill > total = xyz

If you have many more options that offer an exponential amount of combinations, then I suggest using a custom state to hold the running tally of extras…

When checkbox value is changed and is checked > state state (number): state = current state value + value for this extra thing.

When checkbox value is changed and is not checked > set state: state = current state value - value for this extra thing.

Then the total field = base price + custom state’s value.

2 Likes