Forum Discussion

JakeRattner1's avatar
JakeRattner1
Qrew Cadet
3 years ago

Use Pipeline to Remove an attachment from a field

Does anyone know how to remove/delete an attachment from a field using a pipeline?  I'm trying to use "update record" and am not seeing any option to remove an attachment. It looks like the attachment field isn't an update option in the "update record" UI.

What I'm trying to do is have the user upload an attachment.  The attachment gets added as a child record and then removed from the field where it was attached on the parent.

Thanks,
Jake

------------------------------
Jake Rattner
------------------------------

2 Replies

  • I know it can be done with an API call and a Pipeline can call an API. 
    Here is a partial pseudo example where fid 9 was a file attachment.

    ?act=API_EditRecord
    &rid=43
    &_fid_9=
    &delfile_fid_9=1


    So I think that you can do like this

    https://mycompany.quickbase.com/db/xxxxxxx?a=API_EditRecord&rid={{a.id}}&_fid_9=&delfile_fid_9=1
    Method = POST

    I have not tested this though. Let us know if it works.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
  • I know this is an old post but here is how make this happen.  I make a callable pipeline so I can use in any app/any table.  Below is the YAML after updating your URL/Usertoken you should be able to import to pipelines.  Then just call the pipeline with the variables.  Seems to work pretty good.  Versioning is a little wierd haven't figured it totally out but 1 file uploaded is not 0 like in the QB-UI, it is actually 1.

    # Purge File Attachments
    #
    # Ust this to purge Files Attachments in any App/Table
    #

    ---
    - META:
        name: Purge File Attachments
        description: Ust this to purge Files Attachments in any App/Table
        tag_names:
        - EARP
        enabled: true
    - TRIGGER cloudpipes-meta pipeline on_called -> a:
        inputs-meta:
          call_definition: PurgeFile(tbid,rid,fid,ver)
    - ACTION webhooks request make -> b:
        inputs-meta:
          oauth_credentials_placement: header
        inputs:
          content_type: application/json
          headers:
            name: 'QB-Realm-Hostname

              Authorization'
            value: 'yourURL.quickbase.com

              QB-USER-TOKEN yourUSERTOKENhere'
          method: DELETE
          url: https://api.quickbase.com/v1/files/{{a.tbid}}/{{a.rid}}/{{a.fid}}/{{a.ver}}
    ...



    ------------------------------
    Sales Quickbase Account
    ------------------------------