Maybe it's your lucky day. I am in a small airport waiting room with WiFi waiting for a helicopter to get me across the border into the US.
I don't think the technique is listed in the current Magic Buttons app. I think what happened is a while back Quickbase was talking about blocking the use <iframes>. There was a bit of an uproar from the community and upon further investigation they realize they did not have to be quite so draconian.
During that time Kirk Tracy removed that example from his Magic Buttons App. He may also have removed it because it relies on the goodness of Google to continue to provide this free utility.
So with the proviso that this technique relies on the good graces of Google, you can try making a formula Rich Text called [Report Link PDF Viewer formula]
If(
[Document Name] = "", "No File",
"<iframe src=\"
https://docs.google.com/gview?url="&URLRoot() & "up/" & dbid() & "/a/r" &[Record ID#] & "/e
99/v0" & "&embedded=true\" width=\"800\" height=\"2400\" frameborder=\"0\" target=\"_blank\"></iframe>")
// set the height and the width of the PDF preview window in the line above
//Replace
99 with the field ID of the file attachment.
Then make a report link field and configure both the left and the right matching fields to be that same report link formula field above. The viewer should be able to preview the usual kinds of documents including Excel, Word and PDF, and I believe Powerpoint.
Oh, and importantly as Mike stated, you need to set the checkbox on the file attachment field so it can be accessed without logging into Quickbase. Google needs to be able to look at your file in order to preview it. But since their motto used to be "do no evil", I'm sure your secrets are safe with them. But that is for you to judge. :)
Let us know how it goes.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.commark.shnier@gmail.com------------------------------
Original Message:
Sent: 06-09-2021 11:57
From: Mike Tamoush
Subject: How to display PDF in file attachment fields
Have you tried the solution in Magic Buttons? I seem to remember I was able to get that to work, however I couldn't use it because it only works with the file attachment field is open to everyone, and for security reasons we could not do that.
I never found another good solution for when attachment field is private.
------------------------------
Mike Tamoush
Original Message:
Sent: 06-09-2021 09:41
From: Zach Shumate
Subject: How to display PDF in file attachment fields
Does anyone have the final solution here to get this to work? I was not able to find this in the magic buttons application and cannot get the formulas listed to work either.
------------------------------
Zach Shumate
Original Message:
Sent: 06-17-2019 13:25
From: Wes McAda
Subject: How to display PDF in file attachment fields
Another thought I had is if it would be possible to use a rich text field to display a button that - when clicked - actually attaches a file to a record (from the established location), redirect/refresh to the record, and then display.
Basically, this would be a step between my URL field to the PDF on my network and the file attachment field that is displaying as needed.