Updating shopify inventory in airtable only when inventory has changed

Hi

I have a flow that pulls in product inventory counts from shopify and compares it to my product inventory counts in airrtable.

This results in this data set:-

At the moment, when this runs it updates all 260 products in Airtable


{
	"fields": {
"Variants: Id":"{Variants: Id}",
"Variants: Sku":"{Variants: Sku}",
"In Stock":"{Variants: Inventory Quantity (1)}"
},
	"typecast": true
}

However, I’d like to add a step in my flow that only sends the products with inventory that has changed, to airtable.

I’ve tried adding a Remove Rows step but this doesn’t seem possible to configure.

In essence I only want to update rows in Airtable that have different Inventory Quantity from that in Shopify. Is this possible?

Thanks

Jonathan

Hey Jonathan!

I think I see two Quantity columns, so could you use the Remove Rows step to only keep rows where Quantity Column 1 Does Not Equal Quantity Column 2?

Also, you will need to replace your blanks in one of the quantity columns to be 0’s for the above to work. To do so, use a ReGex step to find ^$ and replace it with 0. That ^$ is the expression for a blank cell.

Thanks Brian - how do I reference the other column? It doesn’t allow me to actually select a column, just add a value

Thanks

Jonathan

It seems I can add a value but not choose the field to compare to the first quantity field. I can type the field name in but it has no effect.

@Jonathan_Lyon Try using the Insert If/Else step first.

As you can see, by wrapping my column names in curly braces {}, I can reference the data in another column.

Then, you’d use the Remove Rows step to filter for rows where the If/Else determined that Quantity Column 1 does not equal Quantity Column 2.

Let me know how that goes!

Hi Sachi

That’s what I ended up doing before you sent your solution but thank you :slight_smile:

Thanks

Jonathan

3 Likes