Forum Discussion

IrisBonilla's avatar
IrisBonilla
Qrew Cadet
6 years ago

Collapsible Square in a Table

Hello!

I'm creating a table for projects that has a Comments field that is is going to be _very_ long, and I was wondering if there was a way to make this field collapsible. Meaning, that if the comments are  very long, to reduce the field to a preview. And there should be a arrow that the user can click on or some button for them to expand the field if they want to read all the comments for that project. 

Thanks!

9 Replies

  • I use this:

    If(Length([Notes])<180,[Notes],Left([Notes],180)&"...<br><a href='"&URLRoot()&"db/"&Dbid()&"?a=dr&rid="&[Record ID#]&"' title='" &
    List("&#39;",Part([Notes],1,"'"),Part([Notes],2,"'"),Part([Notes],3,"'"),Part([Notes],4,"'")) &
    "'>more</a>")

    I use this for building fields to use in reports.  It allows the use to see a pre-fixed number of characters (you can change it from 180) with a "more" link which when you hover on it will display the entire field value.  If the use clicks on the "more" link; it will open up the record.
  • Thank you! However, where do I do this? Do I go to Reports and Charts and make a new report? I just need some clarification or steps on where to put this code. Because the field has already been created,
  • You have to build a formula-rich-text field and the [Notes] field name in my formula needs to be replaced with your data-entry text field name.  I usually name the field [Notes (for Rpts)] or something like that, so I can easily identify them from the data-entry fields.  Then you can substitute the [Notes] entry field in reports for the formula field instead.
  • Great! I've put in the formula but have run into this message:

    "A formula may not contain a reference to itself directly or indirectly through another formula."

    So for the notes, I switched it in for "Comments" but I'm guessing that's wrong? I reread your last comment but not sure what to put in for Notes.
  • What is the data-entry field name that your Users enter their notes/comments into.  That's what you need to use where I have [Notes].
  • The field name is COP Comments #3 where my user is putting all their comments. However when I keep substituting it COP Comments #3 for Notes, it gives me a warning saying that  I can't use that field and that instead I have to my other fields that are Text only fields.

    However, I've tested it out a different way that does work but has some issues. I decided to make another field called "Notes" and in the square brackets I put in the "COP Comments" which is a Text-Multi and it works. The "Notes" field now hides comments until the user clicks on more. 

    But the issue is that not the user will have to input the comment in another field and have what they have written in two fields, one that will be fully expanded and the other that is hiding it. This can confuse the user if we are making them input in one field and have it appear somewhere else
    • IrisBonilla's avatar
      IrisBonilla
      Qrew Cadet
      Before I made the "Notes" field and added the code, it was a formula multi-line where I was trying to add the code there, but after creating the "Notes" I restored it to Text multi-line
  • To get the most efficient use of screen real estate I would use script. This example could easily be modified to display the lengthy comments rather than the related child records:

    Subdatasheet ~ Click on Plus Sign To Expand Children
    https://haversineconsulting.quickbase.com/db/bmnf7nrvf?a=td

    Another option would be to use script and popup a dialog box. Perhaps you can draw inspiration from one of these dialog demos contained in this post:

    How To Dialog?
    https://community.quickbase.com/quickbase/topics/how-to-dialog