Skip to main content
Question

Pipeline to remove file attachments

  • June 2, 2023
  • 0 replies
  • 1164 views

Forum|alt.badge.img+1

I am trying to investigate if there is a way to use a pipeline to remove file attachments?  I am automating a process to incorporate data into our system using CSV uploads.  The issue is that I would like to keep some of the information from the upload available (e.g. the Requestor, Date Uploaded, File Name) but I don't want to actually archive the file on QuickBase due to space limitations.  Is there a way to just delete the file itself without deleting the entire record?  You can of course click into the file and manually delete it (see below), but I want this to be automated as I won't be doing the uploads myself.  The field type is "file attachment" and it appears to be stored as a URL/Link.  It does not behave like other fields in the pipeline and I have not found a way to override it yet.  Thanks!



------------------------------
Kevin Gardner
------------------------------

MarkShnierYou
Forum|alt.badge.img+24

You should be able to use a Make Request Step in A Pipeline.

First make a formula URL field on the table to have it generate the code.

URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_9="
& "&delfile_fid_9=1"

Then expose that code result and copy paste it into the Pipeline make request URL.

The carefully hand edit it in the Pipeline step as you need to get rid of the hard coded record ID that you see, and instead drag down the reference to the record ID to be deleted form the trigger step.

for example it would probably need to be {{a.id}}

Also I think you need to select it as POST and not GET method.

Feel free to post back it you have any issues as I did not recently test this.



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

Forum|alt.badge.img+11

HI MarkShnier__You 

Thanks for posting the technique. A small heads up , we can directly post this URL in pipeline without making URL formula too.

https://xxx.quickbase.com/db/btb5popo?act=API_EditRecord&rid={{a.id}}&_fid_261=0&_fid_83=&delfile_fid_83=1

{{a.id}} being the record ID
fid_83 attachment field


ReneeHansen1
Forum|alt.badge.img+6
  • Registered
  • April 24, 2024

I had this problem with a build I did. I ended up using Sharepoint to store the file, that way we didn't use document space on Quickbase. Then I made a URL button to "view the document" so you could pull it up from sharepoint straight from QB.


Forum|alt.badge.img+8

Since I can't delete the post, please disregard what I said below this.  I was using GET and not POST when running my Make Request. 

Also keep in mind that when using this technique, Quickbase still keeps a backup of these files that utilizes your attachment space.  You can find this in App Management > Manage File Attachments.


rbuschmeyer
Forum|alt.badge.img+2
  • Registered
  • January 24, 2025

I am attempting to do this as well, but the version parameter easily breaks because I can't seem to find a way to dynamically populate that into the URL.  The JSON Restful API does a great job to deleting the version if you identify it...but the moment someone uploads new, the table gives it a new version number...not "1"...even if you tell the field to only keep 1.