Discussions

Expand all | Collapse all

File Link -> URL with Path

  • 1.  File Link -> URL with Path

    Posted 02-04-2020 15:37
    Edited by Earl Adkins 02-04-2020 16:18
      |   view attached

     

    "https://core.federatedservice.com/apps/downloads/dynamic_workorder.php?"

    & "clientid=Q1752"

    & "&appid=bhv9szun5"

    & "&tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]

    & "&tpid=1"

    & "&fn=WorkOrder_" & [Work Order #]

    & "&msid=" & URLEncode ([Record ID#])

    & "&msdb=" & Dbid()

    & "&faid=592"

    & "&efpdte=593"

    & "&addfiles="

    & "&docfmt=pdf"

    & "&stream=y"

    & "&apptoken=d3dzsz2cndv7n7bbg5y8q87xbw4"

    & "&doc_name=" & "WorkOrder_" & [Work Order #] & "_" & [Record ID#]

    & "&file_name=" & "WorkOrder_" & [Work Order #] & "_" & [Record ID#]

    & "&file_link=" & "https://fss.quickbase.com/up/bhv9szup6/g/rb3tz/eus/va/WorkOrder_" & [Work Order #] & "_" & [Record ID#] & ".pdf"

    & "&customer_rid=" & [Related Customer]

    & "&project_no=" & [Project #]

    & "&project_rid=" & [Related Project]

    & "&workorder_no=" & [Work Order #]

    & "&workorder_rid=" & [Related Work Order]

    & "&visit_rid=" & [Record ID#]

    & "&partner_rid=" & [Related Deployment Partner]

    & "&technician_rid=" & [Related Technician]

    & "&is_internal_download=true"

    & "&user_name=" & URLEncode(Trim(UserToName(User())))

    & "&user_email=" & URLEncode(Trim(UserToEmail(User())))

     

    This formula calls our javascript code, which in turn invokes your aspx code thusly:

     

                    var wko_link = 'https://www.quickbaseutilities1.com/FederatedServices_1752/DocumentMerge/doc_merge_UA.aspx?'

                            + 'clientid=' + $.url.param('clientid')

                            + '&appid=' + $.url.param('appid')

                            + '&tpdbid=' + $.url.param('tpdbid')

                            + '&tpid=' + $.url.param('tpid')            // Record Id of the specific document template

                            + '&fn=' + $.url.param('fn')

                            + '&msid=' + $.url.param('msid')

                            + '&msdb=' + $.url.param('msdb')

                            + '&faid=' + $.url.param('faid')            // faid=file attachment field  & efpdte=date document was created

                            + '&efpdte=' + $.url.param('efpdte')

                            + '&addfiles=' + $.url.param('addfiles')

                            + '&docfmt=' + $.url.param('docfmt')       

                            + '&stream=' + $.url.param('stream')

                            + '&apptoken=' + $.url.param('apptoken');

     

    This all works as we intend, and dynamically creates the desired work order file, calling the Exact Forms Plus

    code indirectly instead of directly. But it appears that the line in our code ("&file_link=" & "https://fss.quickbase.com/up/bhv9szup6/g/rb3tz/eus/va/WorkOrder_" & [Work Order #] & "_" & [Record ID#] & ".pdf") fails to save the correct path to the dynamically created work order. Our guess is that the value "rb3tz" in that line should be a variable, as it seems to change in the different dynamically created work orders. But we do not have any idea how that value "rb3tz" is created. Is there any way we can calculate that value ourselves? Or is that even a 'good' solution to our problem of saving the url?

     

    We tried using the "Work Order Document" field that Exact Forms Plus fill in the Site Visits table (which we read via the QuickBase Do_Query API), but the API seems to only return the file name, not the entire path to the file. We assume this is because it is not a URL field, but a File Attachment field. This is strange, since when we hover a mouse over the value in the Site Visits table, it does show the entire url at the bottom of the screen (see screenshot below).

     

    To reiterate, when we look at our QuickBase Site Visits table, we see that the Exact Forms Plus aspx code IS in fact storing the file, and saves what appears to be a link to it in the "Work Order Document" field which I have circled in the screenshot below. Hovering a mouse over the "Work Order Document" field reveals the url link to the file at the bottom of the page, which I have also circled. But we have been unable to retrieve this entire url through the Do_Query API, getting instead only the file name. We notice that the path in the url seems to have a different value for each different document created where we see "rb33r" in the screenshot below (which I have underlined in red). Other than this value, we believe the path is always the same for other dynamically created work orders.

     

    Can you offer us any advice on how to save the path to the work order dynamically created by the call to Exact Forms Plus? Whether by dynamically creating our own path to the file or by somehow reading the path underlying the "Work Order Document" field?

    scrn-shot

    Thank you.



    ------------------------------
    Earl Adkins
    ------------------------------


  • 2.  RE: File Link -> URL with Path

    Posted 02-04-2020 15:41
    Earl, you are using Exact Forms Plus which is an Add on from Juiced.  So you may need to go directly to Juiced for Support.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: File Link -> URL with Path

    Posted 02-04-2020 15:50
    Edited by Austin K 02-04-2020 15:55
    Appendix B: Managing files

    https://target_domain.quickbase.com/up/DBID/a/rRID/eFID/vVID

    Is that helpful at all for this?

    The part you mention "rb33r" or similar is the record id encoded with QB32Encode(), they also have a decoding function. I checked and QB32Encode(59183) = b33r, the r is added on to the front by Quick Base as well. I pulled the record id from your screenshot.

    This is something else I've seen done too. You might be able to just insert the record id instead of the encoded one.

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


  • 4.  RE: File Link -> URL with Path

    Posted 02-04-2020 16:28

    Greatly appreciate all the replies.  This is much more information than we started with.

    Thanks again everyone for sharing your knowledge.

    Earl



    ------------------------------
    Earl Adkins
    ------------------------------



  • 5.  RE: File Link -> URL with Path

    Posted 02-04-2020 16:41
    Earl, 
    Austin has the right approach. if you just want to create a link to a file that can be used on a child table, then the folual is

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

    (there was an errant semicolon in Austin's post).

    if you need a formula for a hyperlink so that the user sees a file name, then the formula would be

    var text Words = totext([my file attachment field])

    var text URL = URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0" 

    //where you replace the 7 with the field ID of the file attachment field

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

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 6.  RE: File Link -> URL with Path

    Posted 02-05-2020 08:15
    Many thanks Mark, I will be utilizing the knowledge gained through the insight provided here in the Community.

    ------------------------------
    Earl Adkins
    ------------------------------