One key feature you need to effectively create an application is the ability to employ logic.
Logic is what lets you execute different actions based on criteria you define. This enables your app to do much more than simply display and update information.
Logic is at the core of any programming language, but can be trickier to execute in a low-code product like Knack. We’ve added multiple areas to help: record rules, display rules, conditional fields and more. These all present opportunities to add logic to your Knack apps.
We’re thrilled to announce a major new addition to our logic features: Page Rules.
Page Rules allow you to define criteria on the page level to execute specific actions:
- Show a notification
- Hide a view
- Redirect the user to another page
- Redirect the user to another URL
Here are a few examples of how you could use page rules:
- Hide a form to edit a record if the page role is not an “Editor”.
- Hide a form to register for a class if the class attendance has exceeded a specific size.
- Redirect to a registration form if the logged-in user hasn’t registered.
- Warn the user if they need to update their data or complete some information.
Pages now have a new tab link at the top called “Rules” where you can define these:
Notifications have additional options to indicate priority. You can designate a notification as a confirmation, warning, or alert, which will color code the message accordingly.
Hiding views allow you to hide one or more views on the page:
We’ve added some articles to our Knowledge Base with more information on page rules: