Skip to main content

Currently when we make purchases online, our buyers are saving all invoices as a pdf into our google drive.  Our current zap is triggered by a new file in Google drive. When it finds the file name it looks up records with the order # saved as a pdf (a formula we combined order # and pdf). When the order numbers align it updates the record with the attachment of the invoice. We have run into a problem when we purchase multiple items from a single store all with the same order #. Only one record will get updated and the rest of the records do not get updated with an invoice photo. Is there some workaround so that all the records with the same order # all get the same invoice photo? Or any advice on another way to make this happen?

Hi @aellc 

Good question.

One option is to create a looping Zap that continues to query for matching records until none are found, but that can be Task intensive.

 

The other more advanced option is to use the Airtable API via a Webhooks - GET action step to query for matching records, then process those each using the Looping app.


I have attempted to mess around with the looping zap and cannot find a way to find all those with the same invoice name to attach the same invoice pdf to all of them. It still is only attaching an invoice with the first record it finds with the matching pdf name.

 

My current Zap is as follows:

 

  1. Trigger

New pdf file in folder in google drive- ex. 222.pdf

  1. Action

Find record in Airtable- It searches for a field value matching the title of the pdf. Value = 222.pdf

  1. Action

Update record in Airtable- that invoice pdf links to the Invoice field

 

So what I’m trying to accomplish is if I have one invoice pdf in google sheets named 222.pdf I want it to update multiple records with the matching field name 222.pdf. I’ve tried adding the looping feature at various points in this zap and no matter where I put it it does not find and update more than one record. I’m not sure I am understanding how this works and there is little information online on how to use this feature. I’m not even sure if what I want it to do is possible since it seems like most examples people use looping for is to create new records and I just want to update mine with the invoices attached from google Drive. 


@aellc 

If you still need help after reviewing the below, then consider hiring a Zapier Expert: https://zapier.com/app/get-help

 

There are 2 similar, but different concepts of “loops”.

 

LOOPING APP

The Looping app will handle line items and will work with the advanced approach of using the Airtable API to retrieve multiple records.

App APIs can be used with the Webhooks app as an action step in Zaps.

 

LOOPING ZAP

NOTE: In your use case, you’ll need another Zap that is configured like this:

  1. Trigger: GDrive - New File in Folder
  2. Action: POST Webhook
    1. Uses the Webhook - POST action
      1. Send the GDrive file as part of the data payload

 

Zap Steps

  1. Trigger: Webhook - Catch Hook
    1. Used to trigger this looping Zap
  2. Action: Airtable - Find Record
    1. Used to find an existing record
    2. Create a new View that has Filter conditions where the Attachment field is empty, that way each time the Zap loops it will search for a record that has no PDF attached yet
  3. Action: Filter
    1. Used to check if an Airtable record was found in Step 2
  4. Action: Airtable - Update Record
    1. Map the Record ID from Step 2
    2. Update the Attachment field with the PDF from Step 1
  5. Action: Webhook - POST
    1. Used to trigger the Zap again
    2. Send the PDF value thru again

 

 


@aellc Just checking in here to see if you were able to find success with Troy’s suggestions/Zap outline above. Let us know!