Sharing File Attachments

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

Is there a way to share a file attachment with someone who might have been sent an  alert without being a member of the app? 

 

Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb

Posted 3 years ago

  • 1
  • 3
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
no problem

You can make a URL formula field called [Link to File Attachment URL] with a formula of

 URLRoot() & "up/" & [_DBID_managers] & "/a/r" & [Record ID#] & "/e113/v0"

In the above example replace the [_DBID_MANAGERS] with your own table alias or just dbid() if the file attachment field  is on the table.  The 113 should be replaced by the field ID# of the file attachment field.  The v0 just means to always give the zeroth oldest version, which just means the current version.  So that never changes.

But in an email Notification that link will look like this

https://mycompany.quickbase.com/up/bfa9ukbn5/a/r17/e113/v0


which is pretty ugly.

So if you then create a formual text field with html enabled you can make a hyperlink



var text URL = [Link to File Attachment (URL)];

var text Words = "Click here to see the file Attachment";

"<a href=" &  $URL & ">" & $Words  & "</a>"


That will come though very nicely in the body of an email



Be sure to also click the setting on the file attachment field  

"Allow access to this file attachment from a QuickBase link without signing in"


 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
see last edit
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks Mark. I have created the fields.  For this to work, obviously I have to create a notification using criteria such as 'notify when' a document is added. Do I need to add the newly created URL field under 'additional criteria' for this to work? Just not clear where does URL and hyper link fields come into play.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
The hyperlink is used in the body of the email Notification, not in any criteria.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
This worked great.  The only issue is if there is no file attached, how do we suppress the message.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
Well, the first thing would be not to fire the Notification, if the file attachment field is blank.  You can configure that in the email Notification setup by stating " and after the record is saved the following conditions are true

File attachment field is not equal to ( and leave it blank)

On the link itself if you want it to be blank you can wrap it with an IF

var text URL = [Link to File Attachment (URL)];
var text Words = "Click here to see the file Attachment";


IF(ToText([File Attachment field])<>"",
"<a href=" &  $URL & ">" & $Words  & "</a>")
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks a lot.  I took the second option as we may or may not have an attachment.  Great solution.