Forum Discussion

AlexGale's avatar
AlexGale
Qrew Captain
3 years ago

Automatically clear file attachment field?

Hi, 

I'm attempting to automatically clear the file from a file attachment field. I've tried using actions, automations, and pipelines and I haven't been able to figure out a way to do this. Is there a way?

------------------------------
Thanks,
Alex
------------------------------

7 Replies

  • here are some cheat notes that will help.
    URL to delete a file attachment

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





    Because someone else might come along looking for this: here's the XML version:

    <qdbapi>
    <udata>mydata</udata>
    <ticket>auth_ticket</ticket>
    <apptoken>app_token</apptoken>
    <rid>[record_id]</rid>
    <field fid="[field_id]" filename="delete"></field>

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
  • @Alex Gale

    It looks like there isn't any explicit support in Pipelines for deleting a file attachment.

    You could use the "Make Request" action in the Quickbase Channel under "Quickbase APIs" for this. This basically allows you to create your own custom Quickbase Pipeline Action (You just have to know enough about the API to form the call)

    @Mark Shnier (YQC) has done some of the heavy lifting for you in his reply, if you wanted to use the HTTP API instead of the Restful API.



    ------------------------------
    Justin Torrence
    Quickbase Expert, Jaybird Technologies
    jtorrence@jaybirdtechnologies.com
    https://www.jaybirdtechnologies.com/#community-post
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew Champion
      Here is an example of how to make a webhook to Quickbase


      Webhook.
      Make Request
      a bunch of the top fields are left blank

      URL
      https://mycompany .quickbase.com/db/xxxxxxxx (ie the target table) 

      Method
      POST

      (more)

      Content Type
      Application/XML

      (strangely, the Body is entered next but when saved comes back in the sequence below)

      Headers (list)
      Name
      QUICKBASE-ACTION

      Value
      API_RunImport  ( in your case API_EditRecord) 

      Body
      <qdbapi>
      <usertoken>bxv4tx_wve_dcxcxcxcxcxcxcxcxc</usertoken>
      <id>10</id>
      </qdbapi>

      ------------------------------
      Mark Shnier (YQC)
      mark.shnier@gmail.com
      ------------------------------
  • Thank you everyone for your help. I was able to use this advice to create a pipeline with an API call that does what I want. I chose a pipeline because I wanted a branching IF condition, but I assume a webhook would have also done the trick.

    ------------------------------
    Thanks,
    Alex
    ------------------------------