Managing User Records

This article will cover the management of user records in your Knack app.

This article covers the following topics:

 

What are user records?

When you activate users on your app, a unique Accounts table is automatically created. This table serves as a storage space for each user who can log in to your app using their email and password.

These users are recorded as account records, allowing for efficient management of user accounts and logins.

User records are similar to records in regular tables, however contain special user fields that help manage user accounts and logins. These user fields are indicated by a user icon to the right of the field name:

userrecords1

  •  Name: The name of the account the user logs 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 the user's login will allow them access or not. 

  •  User Roles: Any user roles assigned to this user. User roles can be used to define permissions.

Each user's user role record counts as an additional record toward your record limit, in addition to their record in the Accounts table. For example, a user in the Employees user role counts as two records: one for the record in the Accounts table and one for the record in the Employees table.

If the user is also has the HR user role, they count as three records: one for the Accounts table, one for the Employees table, and one for the HR table.

Note: The special user fields can be edited but not deleted.

 

Activating User Records

Before you can use user records with your app, you must first enable Users.

 

Managing User Records

When it comes to adding, editing, and deleting user records, the process works in a similar way to managing any other records in your Knack database.

Tip: You can learn more on managing all app records here.

 

Adding User Records

User records are the same as regular records in Knack, so they can be inserted in the same ways: adding them individually from the Builder, importing from a spreadsheet, or from a form in your Live App.

userrecords2

In addition, users have the option to add user records using specialized registration forms. Users have the option to configure logins in a way that allows them to click on a "sign up" link when they visit a page without an existing account.

This link will redirect them to a registration form where they can create a new account.

Tip: For more information, take a look at our article on Logins and Registrations.

 

Editing User Records

To edit user records, simply click on the pen icon next to the record in the Records section of your Builder, or edit the record directly inline:

userrecords3

Tip: It is also possible to build your app to allow for editing in the Live App. You can learn more on this here.

 

Deleting User Records

To remove user records, simply select the checkbox next to the user records and click on the delete button from the top menu:

userrecords4

Note:  Deleting a user record from a user role table will not delete the record from the Accounts table. If you would like to completely delete the user's account, you must delete it from the Accounts table. 

 

User Role Settings

If there are multiple user tables, the field for user roles will display the roles assigned to each user. Users have the ability to be assigned to more than one role if necessary.

When user roles are assigned, a record representing that user will be created in both the main Accounts table and each user role table to which the user is assigned.

userrecords5

If you make changes to a user's Name, Email, Password, User Status, or User Roles, all of the associated records for that user will be automatically updated, no matter 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 user role table for that user.

 

Updating User Statuses

Different statuses can be assigned to users, which will impact how they can access the app.

userrecords6

User accounts can be assigned one of three different statuses in the Account record:

  • Active: Only users with their status set to "active" will be allowed to login.

  • Inactive: Users will be unable to login and will receive a notification indicating that they do not have access.

  • Pending Approval: Users will be unable to log in and will receive a notification informing them that their registration is awaiting approval from an administrator.

By utilizing checkboxes, you have the ability to simultaneously update the status of multiple users. This functionality also provides you with the option to send an approval email, notifying them that they now have access to the app:

userrecords7

Tip: To send these emails, make sure to select the checkbox labeled "Send approval email to selected users." For more details on customizing this email, refer to the section below on Approval and Account Templates.

Note: Editing the user status via inline-editing on the record from "inactive" or "pending approval" will now automatically trigger this approval email to send as of November 10th, 2023. This applies to inline edits to user statuses made in the Builder/Live App and when the user status value is edited using the "edit" button in the Builder.

 

Emailing Account Info

You have the ability to send emails to users, providing them with important information about their account, including links to access the app. This feature is particularly useful if you manually add users or import them from a spreadsheet.

userrecords8

You can use the checkboxes to select the user records you want to email and click the “Email Info” button. You will be asked to confirm the email before sending it:

userrecords9

Tip: See the section below on Approval and Account Templates for further information about customizing this email.

 

Resetting Passwords

You have the option to reset a user's password and send them an email containing instructions on how to reset it.

userrecords10

To reset the passwords, simply select the user records you wish to email and click on the "Reset Passwords" button. After doing so, you will be prompted to confirm:

userrecords11

 

Account and Approval Templates

To customize the email template that your users receive after their approval, simply click on the arrow down button icon next to the user role table desired or the Accounts table, and select the "Settings" option:

userrecords12

Next, you have the option to choose the "Approval Template" or "Account Info Template" to customize the content of the email that will be sent to your users.

userrecords13

In addition to your email content, you have the option to incorporate user variables that will utilize 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 value. 

Note: Passwords cannot be included in any emails. This is because passwords are immediately encrypted for security reasons and are never stored in a readable form.

Tip: Ensure that you update the link in the email template to correspond with the specific user login page.

 

Notes 

  • If a user is unable to access a page, it is important to verify that they have a record within the user role that grants them access to the page.

  • It is not possible to add multiple records with the same email address.