Users table

The App users table is a special Budibase DB table that stores all of the users that have access to the app.

It is anchored to the top of the Datasource list, and has a unique icon to differentiate it from other tables:

Unlike regular tables, you cannot add rows to the users table. In addition, rows cannot be deleted so that the audit trail remains intact even if a users' access is revoked.

User Management is handled through the Admin Portal, and the Users panel.

The standard columns include:


Created By / Updated By columns

It is possible to add auto-columns to your tables, which includes the created by and updated by columns.

Adding a 'Created By' auto-column

Adding a 'Created By' auto-column

This will create a linked column in the Users table with the following name format:

  • [table name]-created_by

These can be used to display user specific data for the currently logged-in user.

When a row is created through the UI, the user will appear in the 'Created By' column. This is also true of an updated row, where the user will get automatically saved to the 'Updated By' column.

🚧

Autogenerated column

The wand icon indicates that this column is autogenerated and auto-populated.
The values cannot be overwritten or saved manually.

Custom columns

Whilst you cannot edit the standard columns or the auto-columns, you can create and edit custom columns.

This can be useful for adding user metadata innate to your app, formulas, or any other data type you want.


Edit roles

You can also add custom roles to your app. More information here.


Current User bindings

There are globally available Bindings for every column in the Users table, including the custom columns.

For example, these can be used to display the name of the currently logged-in user, or Add filtering on the _id to get related user data.

OAuthToken

When the user logs in using SSO, an OAuth token will be available for use in API headers.




Tutorial: Edit user details screen

When using custom user fields, you may want to allow logged-in users to edit these details. This tutorial will outline how to add a settings icon, that once clicked opens a side panel for customising your user settings.

Step 1 - Add the custom fields

In the Data section click on the Users table. Then click the + icon at the top right to add a new column. Do this a couple of times for a Text Nickname field, as well as an Attachment field for a Profile Picture.

Add a new column

Add a new column

Custom user fields 'Nickname' and 'Profile Picture'

Custom user fields 'Nickname' and 'Profile Picture'

Step 2 - Add the edit user profile button

Navigate to Design, and click Add component and select Sections leaving the Type as Main with sidebar.

Next add a Headline with the following text Binding: Welcome back {{ Current User.firstName }}!.

Now you could easily add a Button, but it would be nice to include a user icon for editing profile info, therefore add a Container instead and set a background and border.

Inside the container, add an Icon, selecting user-fill and set the Size and Color. Then add a Paragraph component with the text 'Edit my profile'.

Step 3 - Edit my profile side panel

Add a Side panel, and nest a Form block. Set the Type to 'Update' and select the 'Users' Table.

Set the Row ID to: {{ Current User._id }} and provide a Title.

Select the Container and click Define actions beside the On click setting. Add the Open Side Panel and select the side panel in the dropdown.

Finally we need to disable the core user form fields that cannot be overwritten, and hide fields we don't want to show.

Eject the form block, and check the Disabled checkbox for the email, firstName, lastName and roleId fields. Delete the status field.

User column

With the implementation of the new User column eventually custom fields to the user's table will become depreciated. Meaning that you will no longer be able to add custom fields to the user's table.

The new intended approach will be to create a new table e.g. Users Metadata and include all the additional user related information here. Then link the users to their rows within this newly created table. From here you will then be able to easily access additional fields based on the user link created with the User column.