Each Knack application starts with an online database - this stores all the data that your application will use.
Step 1 in building your application is defining this data. This happens in the Knack Builder under the Data tab:
How does Knack organize your data?
In Knack, each piece of data you want to store and manage is called a field, and similar fields are grouped into objects.
For example, a Customer object would have fields for name, email, and billing address. An Orders object would have fields for order total, date, and delivery status.
Each field can be a different type, like text, number, or multiple choice. These types define how Knack views your data and how the field is used in your app. For example, a file field is used to upload and download files, while a text field stores and displays simple text.
How does Knack store this data?
Your data defines what is stored in your database and what type of application you can build.
Once your object is defined you can store records in your database using the fields you’ve defined. For example, here’s what stored records look like for the customer's object:
How does Knack use this data?
You can build a Live Application to display and manage the customer records stored in your database. You’ll use the customer fields you added to build forms, tables, and other tools for viewing and managing these customer records.
For example, each customer field is available to add as a form input for adding a new customer:
Or you can use the billing address field to display every customer record in a map:
Connecting your data together
What really makes a database? It’s the ability to define relationships that connect your data together.
For example, instead of each order record existing in isolation, you can connect it to the customer record that made the order. If that same customer makes a second order, you don’t need to keep adding their customer details over and over. You simply connect the second order to the same customer record that already exists from the first order.
Each object lists its connections in the right column. When you add a new connection it creates a special field that defines the connection:
Knack makes connections easy. You don’t need to worry about mapping fields or managing keys, you simply look-up the record you want to connect to.
Here’s example of an order form where you look-up the customer to connect the order to:
Knack uses connections in a lot of powerful ways. For example, using the connection between customer and orders, you could:
Show all of the order records for a specific customer
Add up all the order totals for each customer
Run reports on each customer’s average order total each month
Let each customer login to view their order history
Knack has two special objects that add functionality on top of a normal object:
User Accounts are objects with special email and password fields that are used to manage user logins. You can choose to require logins to access your Live App, and each user record would represent a user account that can log in.
You can create multiple user objects to represent different roles and permissions. For example, you may have Customer users who can log in to one part of your app to view their order history, and Shipping Manager users who log in to another part of your app to view pending orders and ship for delivery.
There are additional security settings available with user logins to help ensure the security of your Live App pages.
Charges are objects that include fields for storing E-Commerce transactions like charge total and date. You can choose to add E-Commerce to your application to accept payments. When a credit card is charged, that payment information is stored in a new charge record.
Both User Accounts and Charges can be used just like regular Objects in your database. They are listed separately to emphasize their special nature:
Up next, learn how to Manage the records in your database in Knack.
You can find the full documentation on Knack in our Builder Guide, here.