Forum Discussion

RaymondSakar's avatar
RaymondSakar
Qrew Cadet
2 years ago

Formula Query for a related record's file attachment URL

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
------------------------------

4 Replies

  • 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
    ------------------------------
    • RaymondSakar's avatar
      RaymondSakar
      Qrew Cadet

      Hi Mark, Yes I can clarify..

      Each Project will have only one child record in the Files table where File Type="Petition" (I ensure this with a table rule). I'd like the URL of that child record on the Project record. I think I could do this by using summary fields and a url formula, but I was curious if I could through formula queries, too.



      ------------------------------
      Raymond Sakar
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        There's more than one way to do this. But the starting point is to get a URL formula field on the child record which will display the file.  

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

        In the formula above, change the e7 to e? where ? is the field ID of the file attachment field.

        Test to make sure that works and then roll that up to the parent record with a combined text summary field. Except the only problem is that the Combined Text Summary field only works on text field type so you'll have to make a mirror field for that which is just a formula text field with that field as its formula.  

        Then once you get the Combined Text Summary field rolled up to the parent you would need another Rich Text formula field to convert that back to a Rich Text field type, it will appear to the user as a hyperlink of the file name which they can click to download.  



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