Skip to main content

Below is a screenshot of my process.

The JavaScript code goes through each Shopify order line item & calculates a sum of the total number of items orders. (Output = {Sum})

I then loop through the rest of the process from 1 to Sum (num of items)

In this loop:

  1. I query a Google Sheet to get all values in column A
  2. Retrieve the last value in the column
  3. Delete that value from the sheet
  4. Create a Firestore document with the following fields:
    1. Buyer Name
    2. Buyer Email
    3. Buyer Address
    4. The retrieved value from the Google Sheet

This is the problem in a case study:

  1. The new order has a total quantity of 4 items
  2. 4 Documents are created in Firestore/Firebase
  3. The first document has the correct retrieved value from the Google Sheet
  4. Documents 2-4 all have the same retrieved value from the Google Sheet.  Different from the first, but the same from 2-4.
    1. It is as the Google sheet actions are only triggered one time.  The rest of the loop iterations just use the same retrieved value as document 2.

 

Hi @OneBear 

For us to have full context, we will need to see screenshots with how the steps are configured.


Okay!  Here are the screenshots in order:

 

 


@OneBear 

Loop iterations run in parallel.

Within the loop add a Delay step. (Delay For or Delay After Queue)

 


Okay I will add a 1 minute delay.  Where should the delay be placed?  Right before the firestore document creation action?


@OneBear 

It should be the first step within the Loop.


You’re the man.

Thanks a ton.


That’s awesome @OneBear! A huge thanks to Troy for lending a hand here!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗


Reply