Table of Contents

Special Objects

Danielle Kellogg Updated by Danielle Kellogg

In the following sections, we’ll cover common workflows and functionality you will need to consider as you group your data into objects.

The special objects covered in this guide are:

  • Category Objects: the records in this object represent categories used in other objects
  • Attachment Objects: attach multiple files to a project or assign multiple contacts to a company
  • Connector Objects: associate different objects with contextual data, like the quantity of a product in an order’s line item
  • Movement Objects: track the movement or transfer of people or goods, like employees being transferred to a different office
  • Transitional Objects: these objects are not static, as an order moves through the ordering workflow it shifts from a quote to an order

This is a companion article to our How to Plan Your Objects guide.

Category Objects

Category objects will allow you to create a more dynamic “multiple choice” type field in one object by connecting it to another object. The records from that connected object become your dropdown options. When you add the connection field, the records of the category object appear as the choices.

Category objects are used when you want to:

  • Create dynamic dropdowns in forms (ex. when preparing a construction estimate, narrow down the product selection by first selecting a product type - lumber, fasteners, paint, etc)
  • “Drill down” into different subsets of data (ex. Students can click on different programs to see the classes offered)
  • Use the same set of options across multiple objects (ex. the department category is used for both employees and managers user roles)
  • Give users the option to edit the categories (Live App users cannot edit multiple choice field options, but they would be able to edit category options. Ex. when you want your admin to be able to add new product categories)
  • Perform exportable calculations on the categories (ex. calculate the number of orders at each stage - quote, in production, delivered, invoice)
  • Enable group-based access levels or multi-tenancy (ex. location managers can only see and edit the inventory at their location)

Our Product Catalog demo app is a good example of when you’ll need a category object to allow your users to “drill down” through the categories in the Live App.

On the first page, your user can view the categories of products. In this case, it’s pet products.Then, your user selects a category to see the products in that category. If you select the Toys category, you will see our toy products - a chew toy, a rope toy, a frisbee, and so on.

In Knack, these categories are split into their own separate object.  

In the Product Catalog demo app, we have objects for Products and Categories. The Category object has only one short text field: Category Name. Each category record represents a category, so in this app our category records are: Toys, Grooming, Food & Treats, etc.

When your Products object connects to your Category object, you’ll have a connection field from which you can select a category for each product in your catalog.

The connection field functions just like a multiple choice drop-down. Whenever you add or edit a product record, you can select a category from the drop down. That is what controls which products show up when your user selects a category in your Live App.

Learn More:

Attachment Objects

There are some scenarios where you want to give your users flexibility in how much data they can append to a given record.

For example, our Real Estate Listings demo app has the flexibility to accommodate a custom number of photos for each Listing. One Listing may only have one or two photos. Another may have 20 photos.

You don’t want to add 1, or 2, or 20 image fields to your Listings object. If you do that, some Listings will have many empty fields and other may not have enough fields for all their images.

Instead, you create a separate object called Images and connect it to your Listings object, allowing you to have only as many photos as you need per product.

Some other examples of when you may want to add one, or multiple, data types to a record:

  • A job applicant has many previous jobs
  • A project has many files
  • A company has many contacts

In these scenarios, we need two objects:

  • Applicants and Employment History
  • Projects and Files
  • Companies and Contacts

You can perform calculations on aggregate data using attachment objects. For example, use a count formula in the Real Estate Listings object to count up the number of photos for each listing.

Learn More:

Connector Objects

Some objects exist to connect two different types of data while providing additional contextual data.

For example, in an ordering app you add products to an order. If you connect Products and Orders directly, you have no way to specify how much of each product you want. So we will add another object in between - Line Items. With that object, you gain a lot of flexibility. You can:

  • Specify the quantity of each product that you are adding to each order
  • Calculate subtotals for each product that you add to an order
  • Perform order-level calculations such as order total and number of products per order

You can see what it looks like to use connector objects in our Quotes and Invoices demo app:

Our Warehouse Manager demo app also shows a good example of a connector object. In this app, we have objects for Warehouses and Products. We want to know how many products exist at each location. However, that data doesn’t actually identify either Warehouses or Products. Remember - each object only contains identifying data. A location is not defined by the number of products stored there, and a single product type can exist in multiple locations.

We need an object that tells us how much of each product exists at each location. Enter Warehouse Inventory. This object connects Locations and Products by telling us how much of a given product is at a given location at the current time.

Warehouse Inventory tells us exactly how much of each Product exists in each Warehouse.

It also allows us to store additional data relevant to that relationship, such as the Product’s exact location within the Warehouse . How it does that is via a movement object - Stock Transfers. See the next section to learn more.

Learn More:

Movement Objects

Some objects represent the movement of something, like products between warehouses. In this scenario, not only do we want to track the current location of the product, but we want to keep a history of that products’s movement.

Movement objects are similar to connector objects, in that you can track additional data like the product and quantity. The difference is that movement objects have an origin and a destination.

For example, your company owns multiple warehouses and you want to track the movement of your products through different warehouses. In this case, you will need a Stock Transfer object. This object allows us to track the key data points of the movement:

  • Origin
  • Destination
  • The product being moved
  • The quantity of the product being moved

By using this object to track movement, we can use formulas and equations to calculate the current stock of each location in real-time. We would not be able to do this kind of tracking without a movement object.

Other examples of movement:

  • An employee being transferred to another team or office
  • A truck being moved from one construction site to another
  • Whether a book or piece of equipment may be in stock

Learn More:

Transitional Objects

Sometimes you have data that may seem like it should be split in different objects, but carrying over connected data becomes a challenge.

For example, in an ordering app you may think of creating objects for Orders and Invoices. But they share a lot of connected data - the Line Items. The Line Items are the products added when a quote is generated. It’s important to associate a Quotes’s line items with the ensuing invoice.

In Knack, there’s no way to automatically transfer a Quotes’s line items to the invoice that follows. So, in this case, it’s easier to use just a single Quotes object here.

This Quotes object has a multiple choice field for status - Quote, Invoice, Paid.

When a new order is created, it is in the quote stage. Line items are added, and you just need to change the stage to invoice when the customer accepts the quote.

Using the data source of your views, you can create different views that display the Quotes records that fall into each of the three stages: Quote, Invoice, and Paid.

Another scenario where you can use a transitional object is with an applicant portal. Let’s say you want prospective students to submit applications with essays or other supporting documentation. You want that supporting documentation to carry over to the student’s account when they are accepted and enrolled.

You can create a Students user role with a status field for their stages - Applicant, Rejected, Accepted, Enrolled.

Learn More:

 

How did we do?

Connecting Records Together

Connections: Troubleshooting & FAQs

Contact