Back to overview

How to build a directory with Retool and Baserow

A directory can be an essential tool for any organization that wants to manage its resources effectively. By providing a centralized database, it can help to streamline processes and improve communication, leading to a more efficient and productive workplace.

Retool empowers you to work with your existing data sources and seamlessly connect to your Baserow database. Retool makes it fast and easy to build internal tools. Teams can use Retool to build tools, custom apps, dashboards, admin panels, and other internal tools to run critical operations while saving and editing data in your Baserow database.

Baserow is a modern and open-source online database that allows users to create tables, manage data, and collaborate with others. By integrating the two platforms, users can easily streamline their workflow and data management. You have complete control over your data with Retool because you work directly with your own Baserow databases.

What you’ll need

What we’ll cover

In this tutorial, you will learn how to create a customized backend with the Baserow API. You can use an existing database to create a central data source within your organisation.

Why build with Baserow

Baserow is an open-source database tool that offers a range of benefits to businesses, making it a powerful and flexible choice. With its scalability, security, customization, and versatility, Baserow provides a reliable platform for developing robust database applications.

  • Baserow can handle large amounts of data and users, making it appropriate for businesses of all sizes.
  • As data sets expand, database speed and stability become critical to user experience. Baserow’s scalable architecture ensures consistent performance, even with large data sets.
  • Baserow’s data storage can be kept entirely on internal servers, improving businesses’ privacy and security.
  • Baserow offers a customizable platform, enabling users to build and expand their database applications to meet specific requirements.
  • Baserow easily integrates with other no-code tools, offering a comprehensive and versatile platform for building no-code stacks.
  • Developers can seamlessly integrate Baserow with other tools and services using APIs, webhooks, and plugins, allowing them to build complex and powerful applications with ease.

Let’s get started!

1. Create a database in Baserow

First, we’ll create a workspace called 'Retool App’ on Baserow. On the Dashboard page where you can see an overview of all your workspaces and databases, click the + Create workspace button. This button will also be visible in the sidebar.

Next, we are going to create a database in the Retool workspace to store data. Click + Create new then select Database from the dropdown option. Input a name for the new database and click the From template option:

Create a database in Baserow

By using a Baserow database, all relevant employee information can be stored in a centralized location, making it easy to access and update as necessary. This can include basic information such as names, job titles, and contact information, as well as more detailed information such as job responsibilities, performance evaluations, and attendance records.

2. Create a Baserow database token

Before building your app, we’ll need some data to build with. Retool connects to all your databases and APIs, including our built-in database.

We need to authenticate with the database token before we can connect the data to Retool. Let’s begin with linking the Baserow account to authenticate the database token.

  1. Go to your profile, then navigate to your Settings page
  2. Click on the Database Tokens tab
  3. Click on the Create token + button
  4. Input the name and select an existing workspace
  5. Click on the Create token button to create a new database token for the selected workspace and for the authorized user.

The user’s database access privileges are defined by the database token permissions. If you accidentally expose your database token to the public, we recommend that you generate a new one as soon as possible.

Create a Baserow database token to securely connect data

After you have created your database schema and API key in the settings, your Baserow database provides its own REST API endpoints to create, read, update and delete rows.

The database documentation is generated automatically based on the tables and fields in your database.

To get the API documentation, click on the vertical ellipsis ⋮ beside the selected workspace and select ‘View API Docs’ from the workspace menu.

Retrieve the base URL of the API you want to connect to, URL parameters, headers, etc.

Next, let’s add Baserow a resource to use in your Retool apps.

3. Connect a REST API resource in Retool

Log in to Retool and navigate to the Resources tab.

Resources let you connect to your Baserow database or API. A resource **determines how Retool connects to a data source. You can connect your Baserow database and make it available as a resource in your Retool organisation, allowing you to connect to any database or API.

Navigate to the Resource page. Click Create newCreate a new resource and select REST API to create a REST Query resource.

Connect a REST API resource in Retool

Next, connect a resource, API authentication and pass URL parameters, headers, etc.

Configure REST API

On the Connect a resource page, add your connection information.

  1. Set the name as ‘Baserow DB’. This will be the name for this resource when creating queries in the Retool editor.
  2. Set the base URL as https://api.baserow.io for the hosted version or self-hosted URL
  3. Add query parameters from your database API documentation
  4. Add the token authentication Authorization: Token YOUR_DATABASE_TOKEN as a global header. All your API requests that use the resource will have the right auth headers sent over.

After you enter your connection details, click Create resource and then Create an app to open the App editor.

Configure REST API

After creating a resource for the data source you want to use with Retool. You can select the resource when writing a query so you can interact with the data.

4. Create an app in Retool

Next, create an app to start building with your Baserow DB data.

Create an app in Retool

For this tutorial, we’ll create a simple app. Add a table with the same columns/fields corresponding to our database. Next, we want to add databases to Retool and make them available to query.

5. Query API

We need to connect the resource with the data we want to read. Let’s test the list row endpoint retrieved from the API docs - https://api.baserow.io/api/database/rows/table/145505/?user_field_names=true

When the App editor opens, query1 is created automatically with the resource you added. You can see this in the Resource dropdown in the query editor.

  1. Select the resource created earlier - Baserow DB.
  2. Set the method as POST
  3. If needed, you can update query1 with additional URL parameters, headers, etc. from the API doc - page, size, search, order_by, filter__{field}__{filter}, filter_type, include, exclude, view_id.

To query your API, click Save & Run.

Query API

6. Invite database collaborators

Thanks to collaborative databases, you can establish communication across departments - marketing, sales, technical support, clients, vendors, and distributors.

You can create a secure web application that lets you choose which users can access the database. It’s easy to collaborate with data in real-time.

To invite collaborators to your workspace and grant relevant access:

  1. Switch to the Retool workspace from your Baserow dashboard or by using the sidebar.
  2. Click the vertical ellipses  icon in the right corner next to the workspace name
  3. Click Members.
  4. Input the collaborator’s email address and choose either the Admin or Member permission types.

Invite database collaborators

Baserow Advanced and Enterprise plans come with advanced user management to restrict access by assigning roles to users in workspaces, databases or tables. Roles permit users to execute operations as an Admin, Builder, Editor, Commenter, or Viewer.

Key takeaways

This step-by-step guide on how to build a custom backend with the Baserow API can be adapted to create a powerful backend database for any app.

By using a database, all relevant employee information can be stored in a centralized location, making it easy to access and update as necessary. This can include basic information such as names, job titles, and contact information, as well as more detailed information such as job responsibilities, performance evaluations, and attendance records.

In case you’ve run into an issue while following the tutorial, feel free to reach out to ask for help in the Baserow community.

What’s your use case? Tell us how you use Baserow

September 12, 2023 by Bram Wiepjes
Release 1.20

Baserow version 1.20 comes with email notifications, workspace level audit log, search for calendar view, new shortcuts, context menu improvements, and more.

January 26, 2023 by Georgina Brisk
Best Airtable alternatives
January 10, 2023 by Olivier Maes
No-Code Platforms in 2023
Want to contribute?

Want to write a post in collaboration with us?

How to contribute?