Multiple choice field

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
In Essentials, is there a way to create a multiple choice field with a formula that checks to see if a specific selection is made and if not informs the user?
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
To do that in any version, you would need to create a new text formula field to calculate a warning message text formula.  The text result can be colored in red or any color you like.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Is there anywhere where I could see an example of this? I've only been using quickbase for a short time.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
Here is an example of a formula text field with HTML enabled.  ie check the checkbox.


IF(
[Order Urgency]="High" and [Ship Via]="Ground",
"<font color=red><b>Warning:  The Ship Via is incorrect for this Order Urgency")

That will make the message red and bold.  The <b> means bold.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Thanks. I'll experiment.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
At what point does that get checked?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
Quickbase formulas recalculate as soon as the data fields which they rely on are populated or actually event if not yet populated.  ie a similar to excel, they are live calculations as data is entered and you tab out of the field or select a multiple choice.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Am I correct in assuming the text field with the formula does not get onto the form itself.?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
You do have to put the field on the form so that the user is able to see your warning message.  I thought that was your question - how to alert the user to a warning condition in their data entry.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Generally, where would you put that field? And I assume it's a non enterable field since it's a formula.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
I usually put warnings at the top of the form and use a form rule to hide them if they are blank (to close up the extra space).  I forget if Essentials supports form rules.
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
It doesn't. Any get around?
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Remove the label?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
If you hide the label on the form then it will just be a blank space on the form if the error message calculates to blank.  Not sure if Essentials lets you rename a field to blank on a form.  "Alternate Label"
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
Yes it does allow you to put in alternate text so I think that will work.
Once the error message pops up does the cursor stay focused in the field with the error or do you have to explicitly move the focus back into that field? Or?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
You have to manually move the focus to edit the field(s) with the error(s)
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
This text formula works but does not display in red.
If(
[Quantity1] > 1,
"<font color=red><b>Warning:  Quantity needs to be 1. Try Again")

Where's my error?
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
1. Now it works fine. I'd like to increase the font size
2. It doesn't seem, even with the error message, that you can prevent a user from keeping the bad entry. Correct?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 49,430 Points 20k badge 2x thumb
Play around with the font size like this.  I think that numbers 1 to 5 are valid.


If(
[Quantity1] > 1,
"<font color=red><font size = 2><b>Warning:  Quantity needs to be 1. Try Again")
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 49,430 Points 20k badge 2x thumb
You can use a form rule to abort the save if the warning is not blank.

"When the record is saved"

and [warning message] is not (blank)

Abort the save with message "please correct the error"
Photo of ed cooper

ed cooper

  • 880 Points 500 badge 2x thumb
I don't believe the essentials version allows form rules.
Thanks very much. You've been a great help.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 49,430 Points 20k badge 2x thumb
OK, my pleasure