Forum Discussion

HerberthSolano's avatar
HerberthSolano
Qrew Trainee
9 months ago

delete field attachments

Hello Quickbase community!

I can mass delete field attachments, using a date range, for example from 2016 to 2019, delete the data of that field, not the entire record.



------------------------------
Herberth Solano
------------------------------
  • Are you asking how you can? The API is the fastest way if you combine it with a Pipeline. You can use the Quickbase 'Request' action to hit the QB api and delete a file using an API_EditRecord like: 

    <qdbapi>
    <usertoken></usertoken>
    <rid>[Record ID#]</rid>
    <field fid="YOUR FIED" filename="delete"></field>
    </qdbapi>

    Your Pipeline would search for the records you want deleted, and the Request would delete the file.



    ------------------------------
    Chayce Duncan
    ------------------------------
  • You can use a Pipeline.  I suggest testing it on a demo app first or running the Pipeline with a small limit of say 5.

    Actually I need to do this soon for a client because they are over there file attachment limits with Quickbase and rather than buy more space there are some that we can delete.   So, your lucky day, I just build a pipeline so I would know how to do it. 

    In my case I started with a search where I was filtering on a checkbox formula field called [OK to delete file attachment] and the search specified the file attachment field and that checkbox field in the results.  Obviously I filtered on [OK to delete file] is Yes.

    Inside the for each loop I did a native QuickBase Make Request step with this syntax  

    (note my file attachment field ID was 7)

    https://mycopany.quickbase.com/db/xxxxxxxx?act=API_EditRecord&rid={{a.id}}&_fid_7=&delfile_fid_7=1

    (note because this is writing, it needs to set to "POST" method). 

    That's it. Just a two step pipeline. Search and then for each loop to delete. 



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • BrianSeymour's avatar
      BrianSeymour
      Qrew Assistant Captain

      I was thinking about taking a similar approach, however, with an intermediate step to rename the file based on QB data and then Integrate Quickbase with Google Drive to move the file (to Google) prior to Quickbase deletion. We'd incur Pipeline step runs, but save storage.

      It's interesting we face these storage limits … it seems like there'd be more file storage features as QB has matured over the years.



      ------------------------------
      Brian Seymour
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        Amazon S3 is another low cost option you could integrate with, storage is borderline free. The setup is a more custom but a simple POST request will work if you're using Pipelines, or Juiced has a Product that will automatically do it as well if you're org doesn't have Google or you're not able to use Sharepoint/Onedrive. 



        ------------------------------
        Chayce Duncan
        ------------------------------