Forum Discussion

RichardPfister's avatar
RichardPfister
Qrew Cadet
7 years ago

Form Rule action to Collapse sections

Is there a way to trigger a section to collapse/expand using a form rule?
I have a number of rules that show/hide fields based on conditions usually triggered by user interaction with the form.  But I just realized that the user cannot 'show' these fields manually if they need to.  This is when it clicked that I don't actually want to show/hide the fields, I just want to collapse/expand them for easier use, but still allow the user to reveal them as needed.  I want to do it in entire sections so I could even go for 'if condition = true then collapse section header' (and everything in that section).  I don't think it's possible but I'm very often wrong.  Thanks in advance for any suggestions!

11 Replies

  • You can choose to hide and show sections in form rules. Have you tried that yet?
    • RichardPfister's avatar
      RichardPfister
      Qrew Cadet
      I have not seen an option to hide a *section*.  But even so, would the user be able to unhide it?  I really just want rule-based collapse so the user can uncollapse.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      Form Rules can hide fields or sections.  But there is not a native way to collapse section with form rules.  However, you can now default sections to default to collapsed all the time, and the user can open them if they want.  That  is a new Form setting for the section.
  • You could create a formula text button to change a hidden checkbox to yes or no and collapse the sections based on a form rule on the condition of the checkbox. Simply create a button and checkbox for each section.

    Just do a case or if formula
    • RichardPfister's avatar
      RichardPfister
      Qrew Cadet
      I think the piece that I'm missing is I don't see an Action in the form rule logic that allows collapsing a section.  I see show, hide, un/require, make read only/editable, change, and display message.  I don't want to hide because then the user cannot unhide it if needed.
    • ZintJoseph's avatar
      ZintJoseph
      Qrew Captain
      Yes you can hide a section...your code in your button would be press to hide, press to unhide....

      Something like this

      If([Project Checkbox] = false,
          "<a class='Vibrant Success' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=your app token&_fid_44=1"'>Close Section</a>",
          "<a class='Vibrant Success' href='" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=your app token&_fid_44=0"'>Open Section</a>"
      )

      The fid is the field ID of the checkbox

      Your form rule would be to hide that section when the box is checked. When the button is pressed again, the box would be unchecked, the rule would see false and open the section. The code above is to edit the record. I have not tried this but it should work. Probably need to take out the edit record part since you are not actually editing the record only closing the section.

      The Project Checkbox field would have to be recreated for each section with a different name and you would need a button and form rule for each section
  • Here is a screen shot...it works fine. Think I have my Open and Close wrong on my button

    You can put the button and check box at the top and hide all of the labels to clean it up