This article walks you through building a Warehouse Manager app, allowing you to track and transfer inventory stock across multiple warehouse locations.
The main feature is using Parent-Child Connections and Formulas to route inventory from an "Origin" into a "Destination" and calculate total inventory levels.
Define the Objects
Add a Products object. This stores the details about each product in your inventory:
Add a Locations object. This stores the details about each warehouse location that will be managing inventory:
Add a Location Inventory object. This stores all the details about each individual Product held in each Location.
Add 2 Connection Fields:
- Product - Connects to Products
- Location - Connects to Locations
From the Connections panel on the right, click the “Add Connection” button, select the “Products” object and add it as a one-to-many connection. Repeat this step for the “Locations” connection. The default field can be deleted:
Add a Number Field called “Starting Inventory” that will be used to track how much inventory each location starts with. By default, our locations will always start with 0 quantities:
Make sure the Display Field is the Location field. This is important for selecting between an “Origin” and a “Destination” location:
Add a Stock Transfer object. This stores all the details about each transfer being made between 2 different warehouse locations.
Add 3 Connection Fields, they will all be one-to-many:
- Product - Connects to Products
- Origin - Connects to Location Inventory
- Destination - Connects to Location Inventory
Note: When you add the second Connection field between the Stock Transfer and Location Inventory objects, you will get a warning message:
This is because we are creating 2 connections to the same object. For this app, this is OK! Knack handles each connection individually.
So click the "Got It" button then continue the process by clicking the "Next" button.
Add a Number Field called “Quantity” that will be used to determine how much stock goes from the Origin and into the Destination:
Define the Formulas
Now that all connections are properly in place, we can start calculating inventory levels across all warehouse locations. Add the following Formula Fields to the Location Inventory object:
A Sum that will track total Quantities to the Destination connection:
A Sum that will track total Quantities from the Origin connection:
Inventory On Hand
An Equation that adds Starting Inventory to Inventory Received and subtracts Inventory Sent:
Build the Live App
Add Stock Transfer Form
In order to transfer a Product from one location to another, a Stock Transfer record must be created.
From Pages, add a new page that adds a new Stock Transfer record:
The flow should be as follows: Select a Product, select an originating location, then finally select where the product is going to. Without any filters, this process could become pretty confusing since we have two “Location Inventory” connections.
Edit the Origin and Destination inputs in the form:
- Edit the Show option so that it only shows locations connected to this form’s Product.
- Enable the Custom Option to allow users to add new options. This will be handy for when you have not yet added a product / location combination.
Your form should now look like this:
Add a new Page, this time select the Location Inventory object and display the records in a Table view:
Edit the newly created table. Hover over the Product column and click the edit “pencil” icon to enable the Grouping option. This makes it so that all records are grouped under a single Product row when viewed from the live app:
Enable the Row Summaries setting from the Options section, this will also calculate a summary per Grouping:
Your table should now look like this:
Extend the App
This is the core functionality needed for a basic warehouse manager app: transferring inventory from one location to another via stock transfers. You can easily extend this app to add additional features:
- Add pages to the live app to manage the products and locations
- Add user logins so each user can manage their own location
- Connect each product to a vendor object
- Add scheduled tasks to be alerted when stock levels are low
- Add reports to get a better representation of levels across all locations
- Incorporate customer orders