Forum Discussion
ChristineWhite
Qrew Assistant Captain
Okay I did a quick test and this does work in a form rule:
Formula for #ofGolfers
var number golferOne=If([Golfer1]<>"",1,0);
var number golferTwo=If([Golfer2]<>"",1,0);
var number golferThree=If([Golfer3]<>"",1,0);
var number golferFour=If([Golfer4]<>"",1,0);
$GolferOne + $GolferTwo + $GolferThree + $GolferFour
------------------------------
Christine White
------------------------------
Formula for #ofGolfers
var number golferOne=If([Golfer1]<>"",1,0);
var number golferTwo=If([Golfer2]<>"",1,0);
var number golferThree=If([Golfer3]<>"",1,0);
var number golferFour=If([Golfer4]<>"",1,0);
$GolferOne + $GolferTwo + $GolferThree + $GolferFour
------------------------------
Christine White
------------------------------
JeffRogerson
4 years agoQrew Cadet
Hi Christine, thanks so much for taking the time to do this, and sorry for the delay in reply. Here in Ontario Golf Courses just reopened on the weekend after being closed for five weeks due to COVID concerns, so I was too busy with customers to work on my form rule issue
So, in my table I built a new formula field and even named it after you "Christine White Counter", applied your suggested formula (using my field name being counted)
var number golferOne=If(Trim([NameOnTeeSheet1])<>"",1,0);
var number golferTwo=If(Trim([NameOnTeeSheet2])<>"",1,0);
var number golferThree=If(Trim([NameOnTeeSheet3])<>"",1,0);
var number golferFour=If(Trim([NameOnTeeSheet4])<>"",1,0);
$GolferOne + $GolferTwo + $GolferThree + $GolferFour
And it does the counting......
HOWEVER, when I make a form rule
When [Christine White Counter] <3
Action Display a Message "you must book three or four players for online booking"
Still nothing! The form rule never fires?
------------------------------
Jeff Rogerson
------------------------------
So, in my table I built a new formula field and even named it after you "Christine White Counter", applied your suggested formula (using my field name being counted)
var number golferOne=If(Trim([NameOnTeeSheet1])<>"",1,0);
var number golferTwo=If(Trim([NameOnTeeSheet2])<>"",1,0);
var number golferThree=If(Trim([NameOnTeeSheet3])<>"",1,0);
var number golferFour=If(Trim([NameOnTeeSheet4])<>"",1,0);
$GolferOne + $GolferTwo + $GolferThree + $GolferFour
And it does the counting......
HOWEVER, when I make a form rule
When [Christine White Counter] <3
Action Display a Message "you must book three or four players for online booking"
Still nothing! The form rule never fires?
------------------------------
Jeff Rogerson
------------------------------
- BlakeHarrison4 years agoQrew CaptainForm Rules based on Formulas will need to have the initial action be 'When the Record is Saved' in order to fire properly. For your use case, though, the best practice would be to have the first 3 Name fields be set to be Required. Not just on the Form, but in the Field Properties.
In the future, if your policy changes and you no longer want to require a minimum of 3 golfers, you can go back and update the field properties.
------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
404.800.1702 / http://datablender.io/
------------------------------ - ChristineWhite4 years agoQrew Assistant CaptainDid you update your form rule to "When the Record is Saved" see Blake's reply?
------------------------------
Christine White
------------------------------- JeffRogerson4 years agoQrew CadetTurns out that using a formula field to trigger a message is the problem......
So, as suggested we simply set up the third field name as a required field (and as most people complete forms in the order they appear on the screen, until someone realizes that field is the golden ticket, it should work).
I guess I should mark the problem as solved, plus I learned something.
Thanks all.
Jeff
------------------------------
Jeff Rogerson
------------------------------- BlakeHarrison4 years agoQrew CaptainI would encourage you to set 3 of the 4 name fields to required as this will eliminate the possibility of any errors. Relying on your users to be consistent is an exercise in futility.
------------------------------
Blake Harrison
bharrison@datablender.io
DataBlender - Quickbase Solution Provider
Atlanta GA
404.800.1702 / http://datablender.io/
------------------------------