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.
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.
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
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.
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.