Discussions

 View Only
Expand all | Collapse all

Simple Form Rule Will Not Work

  • 1.  Simple Form Rule Will Not Work

    Posted 05-20-2021 20:48
    First of all to put this in context, I run a golf course and am trying to build a really simple tee sheet that lists the names of golfers signed up to play at a particular time.

    We encourage people to sign up as threesomes or foursomes.

    I have a pre-made table, that includes a record for each tee time for the day.  To make it simple, lets say that table has six fields, time, one field for the name of each golfer in the foursome and a formula field "total number of players" that counts the number of golfers in that record. (and the counter works).

    As we want to encourage golfers to sign up as a threesome or a foursome, I want a very simple form rule that fires a message if the number of players in the record is less than three.

    So, I have a form rule that says if "total number of players"<=" 2 "display the message" you must book a minimum of three players

    When I modify a record and only enter one or two names, the counter shows "1" or "2" but when I hit save, no message is displayed? 

    It seems simple to me, but I have been fighting with this all afternoon.....

    Jeff





    ------------------------------
    Jeff Rogerson
    ------------------------------


  • 2.  RE: Simple Form Rule Will Not Work

    Posted 05-23-2021 10:52
    It might be easier to just require 3 of the 4 Name fields.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quickbase Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------



  • 3.  RE: Simple Form Rule Will Not Work

    Posted 05-23-2021 14:44
    Edited by Christine White 05-23-2021 14:47
    If I am understanding your setup correctly, you have 4 separate fields for each golfer, not a child table correct?  When creating the record, the count will not exist until the record is saved, preventing the error message from triggering.  Instead you can change your rule FROM # of players to <=2 TO: if Golfer 3 is blank.  (You may want to add an override button allowing 1 or 2 golfers to sign up...i.e. if override is not checked and Golfer3 is blank)

    Golfer1
    Golfer2
    Golfer3
    Golfer4


    ------------------------------
    Christine White
    ------------------------------



  • 4.  RE: Simple Form Rule Will Not Work

    Posted 05-23-2021 16:01
    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
    ------------------------------



  • 5.  RE: Simple Form Rule Will Not Work

    Posted 05-26-2021 15:04
    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
    ------------------------------



  • 6.  RE: Simple Form Rule Will Not Work

    Posted 05-26-2021 15:29
    Form 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/
    ------------------------------



  • 7.  RE: Simple Form Rule Will Not Work

    Posted 06-01-2021 14:39
    Did you update your form rule to "When the Record is Saved" see Blake's reply?

    ------------------------------
    Christine White
    ------------------------------



  • 8.  RE: Simple Form Rule Will Not Work

    Posted 06-01-2021 14:47
    Turns 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
    ------------------------------



  • 9.  RE: Simple Form Rule Will Not Work

    Posted 06-01-2021 15:50
    I 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/
    ------------------------------



  • 10.  RE: Simple Form Rule Will Not Work

    Posted 06-01-2021 17:31
    Good point, and it achieves the same thing, but eliminates the possibilty of someone filling in for player two and three, registering only two players, but circumventing the requirement.

    Thanks,

    Jeff

    ------------------------------
    Jeff Rogerson
    ------------------------------



  • 11.  RE: Simple Form Rule Will Not Work

    Posted 05-24-2021 10:22
    If you haven't already, try making the form rule:

    When the record is saved and # of golfers is <=2, display message.

    I don't think the display message fires simply from a formula field changing.


    ------------------------------
    Mike Tamoush
    ------------------------------