How to manage a database table from the admin panel
In TeleportHQ, you can manage any of your database tables from the admin panel, for example a Leads table or a restaurant's Menu table. In the editor's left sidebar, click Plugins → Admin panel, then Manage next to Data the admin panel manages. In the Manage Entities window, pick the table, set its name, sidebar section and columns, and click Add to Admin Panel. TeleportHQ creates a list, a create and an edit page for that table.
Before you start
- Turn on the admin panel. Otherwise the Manage button is greyed out. See How to turn on the admin panel.
- Have the table ready in a connected database: the TeleportHQ database, Supabase, PostgreSQL, MySQL, MariaDB, MongoDB, Firestore, Airtable, CockroachDB, TiDB or Turso. If there is none, the window says "No database tables found. Create tables in your data sources first." See How to create database tables (by hand or with AI).
Steps
- In the TeleportHQ editor's left sidebar, click Plugins (the four-squares icon above Growth).
- Click the Admin panel row. It shows On. Its settings open in a drawer beside the list.
- Under Sections, next to Data the admin panel manages, click Manage. The Manage Entities window opens.
- In Available Tables on the left, find your table. Type in Search tables... if the list is long, for example
leads. Tables already in the admin panel are marked Added and can't be picked again. - Click the table. The Configure Entity form opens on the right.
- In Entity Label, type the name your team will see in the admin sidebar, for example
Customer Leads. TeleportHQ fills in the table's name to start with. - In Sidebar Section, click Custom, Management, Content or Commerce. To make a new section, click + New and type its Section name, for example
Sales. - In Columns, tick where each column shows: List, Create and Update. For example, untick Create for a column the site fills in by itself. The ID column (marked PK) is always left out, and at least one column must stay in List.
- Click Add to Admin Panel.
You can also open Manage Entities from the Pages list: right-click the admin-panel folder, or any page or folder inside it, and click Manage Entities.
Or add a table from the Data Sources panel
- In the left sidebar, click Data Sources and open your database.
- On the table's row, click ⋯ next to View Data.
- Click Add to Admin Panel.
This adds the table right away, named after the table, in the CUSTOM section, with every column. To choose the name, section or columns, use Manage Entities instead.
Check that it worked
- A message says, for example, ""Customer Leads" has been added to the admin panel with full CRUD operations."
- The table is marked Added in Available Tables.
- The
admin-panelfolder in the Pages list has a new folder for the table, with its list, create and update pages. - Publish your site, open the admin panel and find the new item in the sidebar section you chose. See How to open the admin panel on your live site.
Remove a table from the admin panel
- Open Manage Entities again.
- Next to the table in Available Tables, click × (Remove from admin panel).
The table's admin pages are removed at once, without a confirmation, and a message says ""Customer Leads" has been removed from the admin panel." In the Data Sources panel, the table's ⋯ menu also has Remove from Admin Panel. Either way, the table and its records stay in your database, and you can add it again later.
Troubleshooting
"Admin panel must be enabled before managing entities." The admin panel is off for this project. Turn it on first: see How to turn on the admin panel.
"Table "(name)" is already added to the admin panel." The table is already there. Look for its label in the admin sidebar.
"Admin panel data source is not configured." The admin panel lost its database connection. Check the database in the Data Sources panel.
"Failed to create admin pages for "(label)". Please try again." Something went wrong while building the pages. Try again.
"(table) cannot be removed: only custom entities added from data sources can be removed from the admin panel." Tables that come with a feature, such as users or the store's products, can't be removed. In the Data Sources panel their Remove from Admin Panel is greyed out with "This entity is managed by an activated feature."
Good to know
- Sync components, at the bottom of the same window, rebuilds the admin Pages screens after you change your components. See How to build your own admin pages from blocks.
- Rebuilding the admin panel (Regenerate Admin Panel) keeps the tables you added and rebuilds their pages too.
- Deleting a table that the admin panel uses from your database can turn off the admin panel. TeleportHQ lists the impact before you confirm.