Text in report "More/Less" option

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a text field with large text. The problem is that the text appears huge in the reports. I know QB has some logic to include "More/Less" option for the text column to show/hide more text. Can anyone let me know if they have encountered this option and how to use it??

Photo of Kiran

Kiran

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of Craig

Craig

  • 0 Points
Hi Kiran,

You can create a Formula Text field that will show the first 100 characters of the text field. You would replace the Text Field with the Formula Text field in the reports. Here is an example.

Left([text field], 100)


[text field] would be replaced with your Text Field name

Thank you,

Craig
Photo of Kiran

Kiran

  • 0 Points
Hi Craig.. I believe that Quickbase can automatically show/hide extra text and not formulating the field to show only the first few words. I am still searching for a more generic answer though. Thanks for the suggestion but I remember Quickbase has a more precise way of show/hide text in the report.
Photo of Kiran

Kiran

  • 0 Points
I found the answer. Create a formula field with the below formula. You can replace the field name with the field and the number 50 with the number of characters you want to see on the report.



var Text a = Left(<Field Name> ,50);

var Text b = NotLeft(<Field Name>,50);



If (<Field Name><>"",

$a & 

" <a onclick=\"$(this).hide();$(this).next().show().next().show();\">More</a>" &

" <span style='display:none'>" & $b & "</span>" &

" <a style='display:none' onclick=\"$(this).hide();$(this).prev().hide().prev().show();\">Less</a>"

)
Photo of Jason

Jason

  • 0 Points
This is great, exactly what I was looking for.  I do have one problem.  If the field changes, the formula above does not.  What do I need to make the formula above update as the filed "text" is updated?