Discussions

 View Only
Expand all | Collapse all

Using Quick Base Action to copy file attachment

QuickBaseCoach Dev./Training

QuickBaseCoach Dev./Training10-10-2018 23:42

QuickBaseCoach Dev./Training

QuickBaseCoach Dev./Training07-18-2017 21:14

  • 1.  Using Quick Base Action to copy file attachment

    Posted 06-29-2017 19:39
    I currently have a Quick Base Action set up that does the following:
     - Creates a new record in a different table when a certain box is checked
     - Copies several fields from the original record to the new record

    How can I get this to also copy a file attachment to the new record, whether using Quick Base Actions, Webhooks, Formula fields, or anything else? I cannot seem to find a solution to this exact scenario.


  • 2.  RE: Using Quick Base Action to copy file attachment

    Posted 06-29-2017 19:47
    That cannot be done by mere mortals.  You would actually need to engage with a Quick Base Solution provider to do that.

    But how about just putting a link on the new record.

    The formula for such a link would be

    URLRoot() & "up/" & [_DBID_my table name where the file] & "/a/r" & [Record ID# of the record with the file] & "/e30/v0"

    Change the e30 to exx where xx is the field ID holding the file.


  • 3.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 15:04
    Appreciate your response to this last month, it worked brilliantly! However, I'm running to a different issue concerning the button links I have created to these URLs.

    I have 7 record attachments that "copy over" in this way from one table to another (the links appear as buttons on the new record).

    However, not all of these attachment fields will actually have an attachment (usually only 2-3 attachments were actually uploaded). Quickbase is somehow copying URLs for attachments that do not exist and showing the buttons on the new record - how do I prevent this? When you click the link button, it takes you to a page that says the attachment doesn't exist. How can I tell it to not copy this field if it is blank?


  • 4.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 15:18
    I suggest that you make a field which is the ToText value of the file name.

    Then set a Condition for the Action to fire only when that is not blank.


  • 5.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 15:55
    Could also handle this a step before that and just embed the current button code within an IF() function that tests whether or not an attachment exists for that button, and if it doesn't, hide the button so it can't be clicked.


  • 6.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 16:29
    I'm not sure what you mean the "make a field which is the ToText value of the file name."

    Would you mind elaborating?

    Right now I have a Formula-URL field which copies the URL of each file attachment. So would I need an additional 7 fields to do what you are talking about or is this something that I would be editing in the current Formula-URL fields?


  • 7.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 16:48
    In your formula text field for each button:

    If( Length(ToText([File Attachment Field])) = 0, null, <your current button code> )

    This will test the attachment to see if it exists, and if it doesn't, the button will not show and therefore cannot be clicked.


  • 8.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 16:51
    So you are saying I need to create a formula text field that corresponds to each formula URL button?

    Or that I am replacing the formula that is currently there with the one above?


  • 9.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 16:59
    Replacing the current formulas by wrapping them within the IF function. That will let you control whether or not it is appropriate for the buttons to display at all, based on your criteria that not all attachments necessarily exist.


  • 10.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 17:22
    Now I'm getting this:

    Please check the syntax of your entire formula. Possible culprits are a mismatched set of parentheses, missing quotes, or an extra bracket.


    If( Length(ToText([Bid Analysis])) = 0, null,   <URLRoot() & "up/" & Dbid() & "/a/r" & [Req ID#] & "/e81/v0"> )


    I put my current formula exactly as it is, but it is appearing in Italic in the error message so I assuming it is trying to tell me that is where the error is?


  • 11.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 17:24
    Sorry. Get rid of the beginning < and the ending > that I put in there. They were merely meant as placeholders to frame the text I entered between them.


  • 12.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 17:29
    Got it working! Sorry you had to spell it out for me so much.

    I swear, the longer I try to get something to work the dumber I seem to become.

    Thanks so much for your help.


  • 13.  RE: Using Quick Base Action to copy file attachment

    Posted 07-28-2017 17:40
    Yay for you! You are very welcome. No worries. I think we've all had to go through the learning curve. Programming kind of sucks because one character being off or missing can tank the whole thing. Very frustrating sometimes. Which is one reason why I so appreciate the QB platform, since it helps to minimize the need for code in the first place.


  • 14.  RE: Using Quick Base Action to copy file attachment

    Posted 10-10-2018 19:26
    Michael,  I believe I am trying to accomplish the same thing however my [File Attachment Field] is on table A and the formula URL field is on Table B.  I don't believe I can include a field from table A in a formula on Table B.


  • 15.  RE: Using Quick Base Action to copy file attachment

    Posted 10-10-2018 19:26
    Michael,  I believe I am trying to accomplish the same thing however my [File Attachment Field] is on table A and the formula URL field is on Table B.  I don't believe I can include a field from table A in a formula on Table B.


  • 16.  RE: Using Quick Base Action to copy file attachment

    Posted 10-10-2018 20:51
    Is there a relationship between the two tables? You will need that. Once it's in place, you can create a lookup field to copy the field from one table and make it available in the other.



  • 17.  RE: Using Quick Base Action to copy file attachment

    Posted 10-10-2018 21:26
    There is however when I tried to create a lookup to the attachment field it wasn't in the list of options.  The name of the File Attachment field is "Attachment 1" and when I select Add Lookup this field isn't shown in the multiple choice drop down.


  • 18.  RE: Using Quick Base Action to copy file attachment

    Posted 10-10-2018 23:42
    Make the formula field I suggested and look up THAT field.


  • 19.  RE: Using Quick Base Action to copy file attachment

    Posted 07-18-2017 19:44
    I thought I was going to get away with not doing this, but I have rolled out my Quickbase app at my company and not so much.

    For some reason I cannot wrap my head around this formula. Am I putting this in as Formula - URL or some other type?


  • 20.  RE: Using Quick Base Action to copy file attachment

    Posted 07-18-2017 21:14
    This will be a URL formula field.


  • 21.  RE: Using Quick Base Action to copy file attachment

    Posted 07-19-2017 00:14
    Ok so I am confused about the [Record ID# of the record with the file] part of the formula. It would need to copy a different record each time, so this doesn't seem like it would work?

    Each record in the destination table would need to have a link to a corresponding record in the original table, but they will be different attachments for every record.

    Is this possible? Or is the only way to do this manually in every record?


  • 22.  RE: Using Quick Base Action to copy file attachment

    Posted 07-19-2017 06:13


  • 23.  RE: Using Quick Base Action to copy file attachment

    Posted 03-25-2018 16:43
    I am trying to access the related record's attachment with Zapier. A URL to the related record's attachment does not let Zapier pull the attachment properly. Any thoughts on how to do this? If I could copy the attachment when creating the new record it would not be a problem.


  • 24.  RE: Using Quick Base Action to copy file attachment

    Posted 03-26-2018 02:03
    Hi Chelsea/Jeff,
      we have a file attachment sweep add-on that will do exactly what you are looking for.  It can sweep the file from a record in one table and either update a record in another table or add a new record into the table. It will also either move into the other table or just copy it if you want it in 2 places.

    You can demo it here:  https://juicedtech.quickbase.com/db/bmzi5qjk7

    When a new record is added, the sweep process can:
    • Sweep the file and DELETE it from the record
    • Sweep the file and KEEP the original file on the record
    Additionally it can be scheduled to run daily/weekly/monthly to sweep records controlled by a Quick Base report.

    Keith