Discussions

Expand all | Collapse all

Is there a formula that will retrieve the url of a file attachment field?

  • 1.  Is there a formula that will retrieve the url of a file attachment field?

    Posted 02-14-2018 22:14
    I'd like to create a field that returns the url of a file attachment in quickbase.  Is there a function in quickbase that will return the url of an attached file?


  • 2.  RE: Is there a formula that will retrieve the url of a file attachment field?

    Posted 02-14-2018 22:38
    Docs:

    https://help.quickbase.com/api-guide/index.html#filemanagement.html

    A URL such as this:

    https://team.quickbase.com/up/bdb5rjd6h/a/r13/e8/v0

    Might be written as a formula like this:

    "https://team.quickbase.com/up/bdb5rjd6h/a/r"; & [Record ID#] & "/e8/v0"

    The essential part is the [Record ID#]. The fid "8" and version "0" are usually hardcoded. The front part of the URL might use the formula function DBID() rather than hardcoding it.


  • 3.  RE: Is there a formula that will retrieve the url of a file attachment field?

    Posted 01-09-2019 20:11
    This was very helpful! In sync tables from one app to another, attachments do not pass through in the sync. However, I was able to create a formula URL for the file attachment with this information which I can pass through the sync. Thanks for the help!


  • 4.  RE: Is there a formula that will retrieve the url of a file attachment field?

    Posted 22 days ago
    [solved] the above solution did not work for me. The url is expecting a letter, not a number. Here is an example of the correct url.
    https://aaa.quickbase.com/up/bq8b53jdm/g/rs/ede/va/Estimate-xxxxxxxxxx.pdf

    I added a few more records until I ran out of alphabet letters and then I got the following link
    https://dti.quickbase.com/up/bq8b53jdm/g/r3/ede/va/Estimate-xysyssyysys.pdf 
    but the record id for that is 25, so the record id does not fit in this space.

    eg if I use the record id on a different file, then the url produced is
    https://aaa.quickbase.com/up/bq8b53jdm/g/r12/ede/va/Estimate-xxxxxxxxxx.pdf
    which gives me a 404 not found page.

    I found another post about this here... [other post about attachment urls]
    It mentioned the encoded record id field, and in the end that is what solved my problem.
    In my formula text field I did something like the following.
    =============
    var text textId = QB32Encode([Record ID#]);
    "https://xxx.quickbase.com/up/bq8b53jdm/g/r" & $textId & "/ede/va/" & [Saved Estimate Letters] 

    also note that I could not use the qb32encode inline
    i.e. the following did not work
    "https://xxx.quickbase.com/up/bq8b53jdm/g/r" & QB32Encode([Record ID#]) & "/ede/va/" & [Saved Estimate Letters] 

    ------------------------------
    Johnnyny
    ------------------------------