When you activate user & login features, a special Accounts object is added to your database. Each user that can login to your app with an email and password will be stored here as an account record.
What are User Records?
User records contain special user fields that help manage user accounts and logins. These fields are indicated by a user icon to the right of the field name:
- Name: the name of the account they log in as.
- Email: the email address used to login.
- Password: the password used to login. Passwords are immediately encrypted so cannot be added to a view to display.
- User Status: the status of the account determines if their login will allow them access or not. See below for more.
- User Roles: any user roles assigned to this user. User roles can be used to define permissions. See below for more.
These special user fields can be edited but not deleted.
Note: Each user's User Role record counts as an additional record toward your record limit, in addition to their record in Accounts. For example, a user in the Employees user role counts as two records - one for the record in Accounts and one for the record in Employees. If the user is also part of the HR user role, they count as three records - one for Accounts, one for Employees, and one for HR.
Activate User Records
User Roles can be activated by clicking on the +ADD button next to Users in the Data section of your Builder:
You can also add Users to your app by pressing the Activate Users button in the User Logins section of your App Settings page:
Managing User Records
User records work like any other records in your Knack database. You can click on the pencil icon to edit each record with a form, or click directly on any value to edit inline.
By clicking the checkbox next to any of the user records, additional features will appear to manage your users.
Add User Records
User records are the same as regular database records in Knack, so they can be inserted in the same ways: adding them directly to the database, importing from a spreadsheet, or from a form in your Live App.
User records can also be added with special registration forms. Logins can be configured so that when a user views that page but does not yet have an account, they can click on a "sign up" link to use a registration form.
For more information, take a look at our article on Logins and Registrations.
Edit User Records
User records can be added by clicking on the pencil icon next to the record in the Records section of your Builder:
Delete User Records
You can delete user records by selecting the User Record and pressing the Delete button in the Records section of the Builder:
User Role Settings
If you have multiple user objects, the user roles field will list the roles each user is assigned to. Each user can be assigned to more than one role if needed.
When user roles are assigned, a record representing that user will exist in the main Accounts object as well as each User Role object that user is assigned to.
When you edit a Name, Email, Password, User Status, or User Roles for a user, each of those records will also be automatically updated, regardless of where those fields were edited.
Editing the User Roles will add/remove records from the respective user roles that are assigned to the user. For example, if you edit a user's roles to add an "Employee" role, a new record will be inserted into the Employee object for that user.
Update Status
Users can be assigned different statuses, which affect how they can access the app:
- Active: only users with their status set to active will be allowed to login.
- Inactive: users will not be able to login and will receive a message saying they don't have access.
- Pending Approval: users will not be able to login and will receive a message saying their registration is pending approval from an administrator.
Using checkboxes (see above) lets you update the status of multiple users at once. It also gives you the option to send an approval email alerting them they can now access the app.
To send these emails, be sure to click the checkbox "Send approval email to selected users." See the section below on "Approval and Account Templates" for further information about customizing this email.
Note: Editing the User Status inline on the record from "inactive" or "pending approval" WILL NOT automatically trigger this approval email to send.
Email Account Info
You can send emails to any users with information about their account, including links to the app. This is useful if you enter users manually or have imported them from a spreadsheet.
Use the checkboxes to select the user records you want to email and click the “Email Account Info” button:
See the section below on "Approval and Account Templates" for further information about customizing this email.
Reset Passwords
You can clear a user’s password and send them an email with instructions to reset it.
Use the checkboxes to select the user records you want to email and click the “Reset Passwords” button:
Account and Approval Templates
To modify the email template your users receive upon approval, click on the "settings" tab for the specific user role.
Once you’re in the settings tab, you’ll see two template links - approval template and account template:
Along with your email copy, you can include user variables that will use the values from the user record.
- {{first_name}}: extract and display the first name from the user name field.
- {{email}}: display the user email field
Note: Passwords are not able to be included in any emails. For security reasons passwords are immediately encrypted and are not stored in any readable form.
Knack Tip Make sure to update the link in the email template to match the link of the specific user login page. Click view app to open each page, copy the URL.
Notes and Troubleshooting
- If a user cannot access a page, make sure that they have a record within the user role that does have access to the page.
- You will not be able to add multiple records with the same email address.
How-To Guides
There are several How-To Guides that use form views to display records: