Skip to main content
Question

Formula Query for a related record's file attachment URL

  • February 10, 2023
  • 0 replies
  • 377 views

Hey Community! Does anyone have a formula for a query to pull the URL of a related record's file attachment field? I'd like the URL to appear on the parent form and the user can click to download the file. Thanks!



------------------------------
Raymond Sakar
------------------------------

MarkShnierYou
Forum|alt.badge.img+24

Can you clarify? Are you saying that the file attachment is on a child record and you want to click a button on the parent record to download the file attachment? What if the parent has Many children? Which child record URL are you looking to pull or do you want to pull them all?



------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------

Forum|alt.badge.img+1
  • Registered
  • March 16, 2025

Hello Mark

This might be (or not) the same problem. I have this formula query that I am trying to use as a link in the parent record. I can display the text in the parent but not the link to the file.

Field in the parent - ToText(GetFieldValues(GetRecords("{6.EX.'" & [Article No.] & "'}",[_DBID_IMAGES]),15))


MarkShnierYou
Forum|alt.badge.img+24

I suggest that you m ake a formula Rich Text field field on the child record to display the image.  Then once that is working, bring that field into the parent record.

I have a few versions but here is one that will display a small thumbnail which is clickable into a larger mage.  First get it working on the child record.  Replace tghe e7 with eXXX where XXX is the field ID of the file attachment field.  This formula assumes that an image file exists (ie not a null file attachment and not like a PDF or other document type Excel / docx).

 

var text SmallPix = "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0" & " height=\"100\">";


var text LargePix = URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e7/v0\"  target=_blank  height=\"2500\">";


"<a href=" & $LargePix  & $SmallPix & "</a>"