Formula field to display links to all revisions in a file attachment field

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a formula field which displays the link to download the current file in an attachment field (using 'v0'). However I'm trying to have it display links to the first 10 revisions (if applicable, if only 4 revisions, only display 4 links).


Here's the formula I'm using:


"<a href='" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v1' target='_blank' >" & [Course Attachment] & "</a>"

So I have this same formula 10 times, 'v1' though 'v10'. It shows 10 links all with the same text (see attached).
The problem is that the revisions have different names (how can I show each name?) and there's only 4 active revisions (how can I only show links with active revisions?)

Thank you!

Photo of Ryan

Ryan

  • 60 Points

Posted 3 years ago

  • 0
  • 1
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Hi Ryan,
Unfortunately, it isn't really likely that you're going to be able to predict the URL's that are created for each file revision.  At least in my experience, file attachment URL's vary.  For me, I could have one version of the file attachment be "/e7/v1" and have the next revision be "/b2/w2".  I don't think that there's anyway to predict this?  Maybe I'm wrong.  Let's hope that I'm wrong!

What you could do as an alternative, however, is simply create multiple file attachment fields for each of the training parts.  (Up to 10 file attachment fields).  This way you can easily update any part of the training manual and still have it display the latest attachment.  Along with that, you would be able to easily show up to 10 revisions while hiding the ones that were blank.

As for your formula field, you'd do something like this... (except you'd do it 10 times in the same field)

If(IsNull([Attachment 1]),"","<a href='" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v1' target='_blank' >" & [Course Attachment] & "</a>")&
If(IsNull([Attachment 2]),"","<a href='" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/f8/v1' target='_blank' >" & [Course Attachment] & "</a>")&
If(IsNull([Attachment 3]),"","<a href='" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/g9/v1' target='_blank' >" & [Course Attachment] & "</a>")&
etc...

Hopefully I've helped a little bit, this seems like an issue that should be easily solved, however I don't have the exact answer you're looking for!  Only a work-around.

Good luck!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
The e7  refers to the field ID number.  it is field ID number 7, so that will never change.  The unknown remains as to how to get at the previous file attachment names in a formula or even to know if they exists.
Photo of Scott

Scott

  • 334 Points 250 badge 2x thumb
Makes sense, thanks!