How to create a pop up thumbnail/snapshot of a formula field text field/Text Multi line field

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

Hi Everyone,

Wonder if you can help me with this. I have a report which currently has a text multi line field in it, which means the line on the report can be short or long depending on how much the user has typed. I don't want the user to have to click into the record to see the text, as this is inefficient for this purpose so limiting the characters or adding a link to the record isn't an option.

What I would like is something similar to a thumbnail where the user clicks an icon and it displays the text field as a popup in full preferably. This would mean the users could do everything in the report.

Any ideas how this could be achieved or if it can?

Jack

Photo of Jack

Jack, Champion

  • 50 Points

Posted 4 years ago

  • 1
  • 2
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
Create a Text formula field with some HTML allowed and add a title attribute to the <img> tag as follows:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=452

See attached screenshot which was grabbed with the mouse hovering over the scroll icon. There probably are more stylized to introduce tool tips using libraries already used with QuickBase pages (jQuery's tooltip comes to mind). However you would have to introduce a couple lines of code to invoke these tooltips.
Photo of Jack

Jack, Champion

  • 50 Points
Thanks Dan, the above works well, simple and effective.
Photo of Ben L

Ben L

  • 100 Points 100 badge 2x thumb
So I'm using this functionality and it's great! I have noticed however, that if there is a ' in the body of text, the text shown when hovering over the icon is cut short at the location of the ' in the body of the text. This causes the icon hover to only show a small portion of the text and the rest shows next to the icon.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
B>I have noticed however, that if there is a ' in the body of text,  ...
To write a formula that deals with apostrophes in the title attribute you have to put an upper limit on the number of apostrophes you will allow. This formula will tolerate four apostrophes:

var Text title = List("&#39;",
  Part([Text], 1, "'"),
  Part([Text], 2, "'"),
  Part([Text], 3, "'"),
  Part([Text], 4, "'")
);

"<img src=https://images.quickbase.com/si/16/118-scroll.png " & "title='" & $title & "'>"

If you want to handle an arbitrary number of apostrophes you have to use script.
Photo of Ben L

Ben L

  • 100 Points 100 badge 2x thumb
Thanks for the super fast answer Dan. This worked perfectly.