Forum Discussion

MikeKlausing's avatar
MikeKlausing
Qrew Assistant Captain
6 years ago

Conditional Logic in Exact Forms

I am using Exact Forms and am wondering how to hide or collapse fields on the exact form if there isnt a value in there. I am having the fields show up on my QB form but if they are blank I dont want that transferrring over to my exact form. I have dynamic rules in my QB form but that doesnt help my Exact form right now. Something similar to this:

Case([Quantity], <1, Hide [Cost],
  > 1, Show [Total Freight $]

  • Late to the discussion, but I only found this looking for help on a similar topic.
    I have an exact form that uses lots of conditionals.  If the field is filled in, it prints the field.  If it isn't filled in, then it prints an alternative, such as a blank line for the recipient to fill in.  Here is an example 
    City ~=if(f['49'] == "") {"                           ";} else {f['49'];}~         

     It has been a while since I put this together, so others more conversant in the language (javascript?) can correct my explanation.
    Field ID 49 is the City on my table.
    The whole script must be enclosed with Tildes, "~"
    "Code" begins with equal "="
    Must have Parens around the Code that will evaluate to true/false for the If. You can use && (and) and || (or) for multi part boolean expressions.
    Values of Quickbase fields are accessed by "f", Bracket [, single quote ', field id number (49 in this case), single quote, end bracket ], ex: f['49'].  In my example, I'm checking to see if the City field is blank.
    == is equal comparison operator.  Off the top of my head I don't remember if not equal is <> or !=.
    Curly braces {} surround the Results you want for True. MUST END WITH A SEMICOLON ;
    Add "Else" with curly braces if you want an alternate value for False put on the form. It also must end with a semi colon.
    Any Text with double quotes make sure it is the "Straight up and down" double quote, not the "left or right leaning" double quote that MS Word likes to use.  It will fail every time, and is difficult to see with old eyeballs.

    If you have a lot of these, the space it takes to type it in makes the form look wacky. It will still evaluate to the proper spacing. Adding Bold or Underline to your text will make the results also have the same characteristics.

    Hope this helps.

    ------------------------------
    AndreaLBest AndreaLBest
    ------------------------------
  • Exact Forms doesn't support any type of logic. If there is no value in a field that you have placed on the form, it will just show as blank (or zero, if it's a numeric). If you need to use logic to show a numeric as blank, you will have to create a formula text field and use that field instead of the original field in your Exact Form