Updating Inventory Quantity in Your Shopify Store Using Formulas with EZ Inventory
We've recently pushed an update to our Shopify inventory management app, EZ Inventory, to allow our users to be able to use formulas when setting the inventory quantity of the products in their Shopify store.
This feature was actually requested by one of our customers. In their inventory feed, they needed to subtract the values of two columns and use the difference as the inventory quantity for their Shopify store. The system that generates the data feed for them doesn't have the flexibility to simply add an additional feed to the CSV file with the computed value already set. So they would have to manually open the CSV, add the new field, do the subtraction, and then upload the file.
With the addition of this feature, those last steps are no longer necessary. Within our app, our customer can simply specify the columns whose values to subtract and assign that to the inventory quantity in their Shopify store. So no changes was needed to the CSV file and our app can just automatically pull the data from their FTP server and sync the inventory quantity at their desired schedule.
What can you do with quantity formulas?
- Set a fixed value to your inventory quantity.
- Perform arithmetic operations based on values from one or more fields in the inventory feed.
- Use conditional logic to determine the quantity if your supplier's feed doesn't provide an exact number for the stock level.
Examples
Below are some sample formulas for different use cases where this feature would be useful.
1. Set a fixed value.
There may be cases where you simply want to assign a fixed quantity to your inventory, such as if you want to bulk update a set of products and make them go out of stock. In this case, simply enter a number in the formula field.
0
2. Calculation based on one or more fields in the data.
Simply reference the column names in the CSV file by surrounding them with double curly braces and use arithmetic operations such +, -, /, or *.
{{ QTY ON HAND }} - {{ SOLD }}
{{ available }} + 1
3. Using conditional logic when the feed doesn't use actual numbers for the stock level.
This is an interesting use case we've found while doing research on issues Shopify store owners encounter when managing their inventory.
Some suppliers or dropshippers, for example, don't use numbers in their data feeds for the stock level. They may simply use something like a traffic light system with the values "GREEN", "ORANGE", "RED", basically telling the seller that the item availability is high, medium, or out of stock.
Shopify doesn't allow setting stock levels this way, you'll need to assign an actual number for your Shopify store. Our app solves this problem by letting you use conditional logic so you can decide which number to assign to which stock level status.
For example, if the stock level for an item is "GREEN", you might decide to set the quantity for that item to 1000. If it's "ORANGE", then assign 500. Finally, if it's "RED" make the item out-of-stock by setting the quantity to 0.
Here's the formula for that:
1000 if {{ STOCK LEVEL }} == "GREEN" else 500 if {{ STOCK LEVEL }} == "ORANGE" else 0
There are probably more use cases out there. If you need assistance coming up with a formula for your store, please don't hesitate to reach out!