Discussions

 View Only
Expand all | Collapse all

Button to download attachments from a separate app

  • 1.  Button to download attachments from a separate app

    Posted 08-29-2022 21:12
    We have a EOTI app "Procurement Portal" and a seperate app "Procurement Manager" and use a pipeline to copy some data from the second app to the first however pipelines doesn't allow the the copying of attachments from the Manager to the Portal.

    Is it possible to have a Button in the Portal app that downloads a related attachment in the Manager app?

    ------------------------------
    Tim Egerton
    ------------------------------


  • 2.  RE: Button to download attachments from a separate app

    Posted 08-29-2022 21:21
    In fact there is a Pipeline step under QuickBase called "Attachments" which can upload an Attachments.  It was the old Automations that could not do that.

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



  • 3.  RE: Button to download attachments from a separate app

    Posted 08-29-2022 21:41
    Hi Mark,

    Thanks for the reply.

    The attachment is uploaded to the Manager app first but we want an EOTI user to be able to download the attachment from the Portal app.

    We can get the "attachment" to the Portal using your "Text" field solution but when we try and download it using a Button it says, rightly enough, field is not an attachment.

    So we need to copy the Manager attachment to the Portal or download it from the Manager app with a Button on the Portal app.

    ------------------------------
    Tim Egerton
    ------------------------------



  • 4.  RE: Button to download attachments from a separate app

    Posted 08-29-2022 21:53

    Ok, right, we don't need a Pipeline as you have a Relationship. 


    Create a Rich Text formula field on the record which has the attachment.  In my example the file attachment field is called [Spec Sheet] and it is fid 12.   So change e12 to your field ie like e99

    var text Words = [Spec Sheet];
    var text URL = URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e12/v0";

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

    Then, lookup that field down to the child and it will be a clickable link to open the file.



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



  • 5.  RE: Button to download attachments from a separate app

    Posted 08-29-2022 22:08
    Hi Mark,

    They are two separate apps (for security reasons, one being EOTI), no relationship.

    ------------------------------
    Tim Egerton
    ------------------------------



  • 6.  RE: Button to download attachments from a separate app

    Posted 08-29-2022 23:39
    Do the EOTI app records know the Record ID of the corresponding record in Manager?

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



  • 7.  RE: Button to download attachments from a separate app

    Posted 08-31-2022 17:31
    Hi Mark,

    Yes it does we are passing the Manager app Record ID# over to the newly created record in the Portal app in the pipeline that creates the new record.

    ------------------------------
    Tim Egerton
    ------------------------------



  • 8.  RE: Button to download attachments from a separate app

    Posted 08-31-2022 17:47
    OK, so we can create the same field but on the child table.


    var text Words = [Spec Sheet]; // you will need to populate a field  in the EOTI app with the file name with the file name

    // change the "xxxxxxxx" below to the dbid characters you see in the URL of the Manager Table.

    var text URL = URLRoot() & "up/" & "xxxxxxxxxxxx" & "/a/r" & [Record ID# of the Manager Record] & "/e12/v0";

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


    //  Be sure to remember to locate the checkbox on the properties of the file attachment field on the Manager table and enable the file to be viewed without logging in.

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



  • 9.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 17:42
    Hi Mark,

    Here's the code but it is saying Site can't be reached.

    // Procurement document name (Formula Rich Text)
    var text Words = [Procurement Document];

    // dbid is from the Procurement Manager App, Procurements table. PM Related Record ID# is from Procurement Manager App, Procurements table.

    var text URL = URLRoot() & "up/" & "_DBID_PROCUREMENTS" & "/a/r" & [PM Related Record ID#] & "/e12/v0";

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

    ------------------------------
    Tim Egerton
    ------------------------------



  • 10.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 18:02
    Two issues.

    Replace the bq5m8kxxx with the similar looking characters form the URL from the Procurements table.  It will be the string you see in the URL after the db/

    Also is your field that holds the file attachment field ID#12?  if not change to 12 to the correct field ID that holds the attachment.


    var text URL = URLRoot() & "up/" & "bq5m8kxxx" & "/a/r" & [PM Related Record ID#] & "/e12/v0";

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

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



  • 11.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 18:20
    Hi Mark,

    It still can't find the site.

    // Procurement document name (Formula Rich Text) in Portal app. Created by pipeline.
    var text Words = [Procurement Document];

    // bskpdh396 is from the Procurement Manager app, Procurements table. PM Related Record ID# is from Procurement Manager app, Procurements table (created in Portal by pipeline) e27 is attachment field in Procurement Manager app.

    var text URL = URLRoot() & "up/" & "bskpdh396" & "/a/r" & [PM Related Record ID#] & "/e27/v0";

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

    ------------------------------
    Tim Egerton
    ------------------------------



  • 12.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 18:28
    For the record you are testing on, is there a valid value in the field

    [PM Related Record ID#]

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



  • 13.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 18:57
    Hi Mark,





    ------------------------------
    Tim Egerton
    ------------------------------



  • 14.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 18:59
    The field type needs to be Formula Rich Text.  I believe the field you have is type Formula Text.

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



  • 15.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 20:03
    Hi Mark.

    Aaaha!!

    Works perfectly, thanks.

    ------------------------------
    Tim Egerton
    ------------------------------



  • 16.  RE: Button to download attachments from a separate app

    Posted 09-01-2022 23:02
    Glad we got there on the end!

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