Forum Discussion

JordanMcAlister's avatar
JordanMcAlister
Qrew Captain
6 years ago

Mass Delete Attachments based on criteria

I just set up a way to delete attachments for future status changes that works off of an automation and a webhook which I had to do because within 2 months, my table had reached 80 GB, so now, whenever the status of a Job reaches "CLOSED" all the pictures associated will be deleted. The thing I need to do now is delete all the picture files of Jobs that are already CLOSED before I set up the status change automation. For all the jobs that are already closed, there will be no change that happens to them that I could use an automation to delete the files, so I was wondering if there is a work around for this? Do I need to make some sort of change that affects all records then use an automation that has a check if records are closed then delete files from there? Will I run into an error if there are too many files that would be deleted from an automation?

Thanks for any help on this

------------------------------
Jordan McAlister
------------------------------
  • An Automation can run on a schedule, for example daily.  I would make a formula checkbox field called [OK to delete] and then after triple checking that the formula is correct, set an Automation to run each night to delete those records.

    An Automation can edit or delete up to 1,000 records.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------
    • JordanMcAlister's avatar
      JordanMcAlister
      Qrew Captain
      well, I don't want to delete the records themselves just delete the picture files that are stored in the attachment fields of those records

      ------------------------------
      Jordan McAlister
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Oh right, you need to fire a webhook.   Can you have an automation update a date/time field to the current time and trigger your webhook off that overnight?

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        markshnier2@gmail.com
        ------------------------------
  • Hi Jordan!

    I am trying to accomplish something similar. Could you share how created your webhook? Specifically, what goes in the "Message Header" and "Message Body" portions to accomplish this action?

    Disregard. I figured out the issue.

    Thanks,

    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      just for others, it will be something like his

      <qdbapi>
      <usertoken>%user.token.xxxxxxxxxxxxx.Jordan McAlister%</usertoken>
      <rid>[Record ID#]</rid>
      <field fid="30" filename="delete"></field>
      <field fid="31" filename="delete"></field>
      <field fid="32" filename="delete"></field>
      <field fid="33" filename="delete"></field>
      </qdbapi>



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