Discussions

Expand all | Collapse all

Can an Automation Delete a File Attachment?

  • 1.  Can an Automation Delete a File Attachment?

    Posted 9 days ago
    Hello, 

    I have a Tasks table and occasionally will attach an image to a task that is being assigned to a user.  An example of this would be attaching an image of a house as a reference point for a surveyor who will be surveying a property.

    When the task is completed, I would like to have an automation delete the now obsolete file attachment so that it doesn't take up space in my application.

    I have not found a way to do this. The automations menu does not even show my file attachment field when I try to set it up as an action.  I'm guessing this is because it isn't possible.  

    Am I missing something? If not, is there another way to do this?

    Thanks!

    Josh

    ------------------------------
    Josh Collins
    ------------------------------


  • 2.  RE: Can an Automation Delete a File Attachment?

    Posted 9 days ago
    First of all, the whole process would be simpler if you had a child table of file attachments because then you could just delete the record.

    I gather you want to retain the record but just remove the file attachment. There is a URL formula button that I could provide which would clear the file attachment on the push of a button. But you would need to push the button.

    But if you actually really wanted to automated it's a little bit technical and we would probably have to work one on one and I could help you set up a process where a webhook would delete the file attachment.

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



  • 3.  RE: Can an Automation Delete a File Attachment?

    Posted 8 days ago
    Hey Mark, I considered a separate table for attachments for the reason you suggested.  But then the process to actually add the attachment gets much more cumbersome, ie- create new record for attachment, upload attachment, save record, select attachment from list in Task.  It's more steps than manually deleting the attachment when completing a task. Is there another way to do this that I am not thinking about?

    I was hoping that an automation could delete the attachment from the record being modified, so I ran with that option first.

    Thanks!

    Josh

    ------------------------------
    Josh Collins
    ------------------------------



  • 4.  RE: Can an Automation Delete a File Attachment?

    Posted 8 days ago
    You can use a webhook.  This post here describes the technique.  If you have never used a webhook before, I suggest sust that you play with a copy of your ap.  post back if you get stuck.

    https://community.quickbase.com/communities/community-home/digestviewer/viewthread?MessageKey=cc763027-d027-4fe4-b424-8dd2f6c1bdaa&CommunityKey=d860b0f8-6a48-487b-b346-44c47a19a804&tab=digestviewer#bmcc763027-d027-4fe4-b424-8dd2f6c1bdaa

    here is some help on webhooks
    https://help.quickbase.com/user-assistance/configure_a_webhook.html

    The body should not need to be as complicated as what that post shows.

    <qdbapi>
    <user token>xxxxxxxxx</user token>
    <rid>[record_id]</rid>
    <field fid="30" filename="delete"></field>
    </qdbapi>


    That would remove the field from field ID 30.

    You will need to set up a user token. https://help.quickbase.com/user-assistance/admin_console_user_tokens.html
     



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