Tutorials8 min read

How to Build a CRM in Retool in 30 Minutes

WitData Team

Retool Development Experts

Published January 15, 2024

Screenshot of a CRM dashboard built in Retool

Building a CRM in Retool is one of the most popular use cases for the low-code platform. In this comprehensive tutorial, you'll learn how to create a fully functional customer relationship management system in just 30 minutes—no coding experience required.

💡 Quick ROI Check: Building a custom CRM traditionally costs $50,000-$200,000 and takes months. Use our free ROI calculator to see exactly how much you could save building with Retool instead. Plus, book this week and save 10% on your first project!

What is Retool?

Retool is a low-code platform that allows you to build internal tools quickly by connecting to your data sources and creating custom interfaces. It's particularly popular for building admin panels, dashboards, and CRM systems because it drastically reduces development time while maintaining flexibility.

According to our experience building 100+ applications, teams can save 75% of development time compared to building custom tools from scratch.

Why Build a CRM in Retool?

Building a CRM in Retool offers several advantages over traditional custom development or off-the-shelf solutions. (Want to understand the broader low-code movement? Read our guide on Low-Code Development Trends 2024.)

Speed of Development

With Retool, you can go from idea to working prototype in hours, not weeks. The drag-and-drop interface combined with powerful SQL queries means you can build exactly what you need without waiting for developers to code every feature.

Customization

Unlike off-the-shelf CRM solutions like Salesforce or HubSpot, a Retool CRM can be tailored exactly to your business processes. Need a specific field? Add it. Want custom workflows? Build them. No more compromising on features or paying for functionality you don't need.

Cost-Effective

Building a custom CRM traditionally costs $50,000-$200,000 and takes months. With Retool, you can build a functional CRM for the cost of the platform subscription (starting at $10/user/month) and a few days of development time.

Prerequisites

Before we start, you'll need:

  • A Retool account (free trial available)
  • A PostgreSQL, MySQL, or other SQL database
  • Basic understanding of SQL (we'll provide examples)
  • Sample customer data (or we'll show you how to create test data)

Step 1: Set Up Your Database Connection

First, we need to connect Retool to your database where customer data will be stored.

  1. Log in to your Retool account
  2. Navigate to Resources in the left sidebar
  3. Click Create New and select your database type (PostgreSQL, MySQL, etc.)
  4. Enter your connection details:
    • Host
    • Port
    • Database name
    • Username
    • Password

Pro Tip: Use read-only credentials for initial testing to prevent accidental data modifications.

Step 2: Create the Database Schema

If you don't have a customers table yet, you'll need to create one. Here's a simple schema that works well for most CRM use cases:

CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) UNIQUE NOT NULL,
  phone VARCHAR(50),
  company VARCHAR(255),
  status VARCHAR(50) DEFAULT 'lead',
  last_contact DATE,
  notes TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

This schema includes all the essential fields for a basic CRM. You can always add more fields later as your needs evolve.

Step 3: Build the Customer List View

Now let's create the main interface for viewing all customers:

  1. Create a new Retool app called "CRM Dashboard"
  2. Add a Table component from the component library
  3. Create a new query called getCustomers:
SELECT
  id,
  name,
  email,
  phone,
  company,
  status,
  last_contact,
  created_at
FROM customers
ORDER BY created_at DESC
LIMIT 100;
  1. Connect the table to the query by setting the Data property to {{getCustomers.data}}
  2. Configure the table columns to display properly

Best Practice: Add pagination to handle large datasets. Retool's table component has built-in pagination support.

Step 4: Add Search and Filter Functionality

A CRM isn't useful without the ability to search and filter customers:

  1. Add a Text Input component above the table
  2. Label it "Search customers..."
  3. Update your getCustomers query to include search:
SELECT
  id,
  name,
  email,
  phone,
  company,
  status,
  last_contact,
  created_at
FROM customers
WHERE
  name ILIKE '%{{textInput1.value}}%' OR
  email ILIKE '%{{textInput1.value}}%' OR
  company ILIKE '%{{textInput1.value}}%'
ORDER BY created_at DESC
LIMIT 100;
  1. Add a Select dropdown for status filtering:
SELECT
  id,
  name,
  email,
  phone,
  company,
  status,
  last_contact,
  created_at
FROM customers
WHERE
  (name ILIKE '%{{searchInput.value}}%' OR
   email ILIKE '%{{searchInput.value}}%' OR
   company ILIKE '%{{searchInput.value}}%')
  AND (status = {{statusFilter.value}} OR {{statusFilter.value}} = 'all')
ORDER BY created_at DESC
LIMIT 100;

Step 5: Create a Customer Detail Modal

When users click on a customer, they should see detailed information:

  1. Add a Modal component

  2. Add Form fields inside the modal:

    • Text inputs for name, email, phone, company
    • Select dropdown for status (lead, qualified, customer, churned)
    • Date picker for last_contact
    • Text area for notes
  3. Create a query to load customer details:

SELECT * FROM customers WHERE id = {{table1.selectedRow.data.id}};
  1. Bind the form fields to the query results
  2. Set the modal to open when a table row is clicked

Step 6: Add Create/Update Functionality

Now let's add the ability to create new customers and update existing ones:

Create New Customer

INSERT INTO customers (name, email, phone, company, status, notes)
VALUES (
  {{nameInput.value}},
  {{emailInput.value}},
  {{phoneInput.value}},
  {{companyInput.value}},
  {{statusSelect.value}},
  {{notesTextarea.value}}
)
RETURNING *;

Update Existing Customer

UPDATE customers
SET
  name = {{nameInput.value}},
  email = {{emailInput.value}},
  phone = {{phoneInput.value}},
  company = {{companyInput.value}},
  status = {{statusSelect.value}},
  notes = {{notesTextarea.value}},
  updated_at = CURRENT_TIMESTAMP
WHERE id = {{table1.selectedRow.data.id}}
RETURNING *;

Pro Tip: Add success/error notifications after each operation to give users feedback.

Step 7: Add Delete Functionality

Include the ability to delete customers (with confirmation):

  1. Add a Button component labeled "Delete Customer"
  2. Set button color to red to indicate danger
  3. Add a confirmation modal
  4. Create delete query:
DELETE FROM customers WHERE id = {{table1.selectedRow.data.id}};
  1. Refresh the customer list after deletion

Best Practices for Production CRMs

Now that you have a basic CRM, here are some best practices to make it production-ready:

📊 Related Guide: Your CRM will handle sensitive customer data. Check out our comprehensive guide on Retool Security Best Practices to ensure your CRM is enterprise-grade secure from day one.

1. Add Role-Based Access Control

Not everyone needs full access to customer data. Use Retool's built-in permissions to:

  • Give sales reps read/write access to their own customers
  • Give managers full access to all customer data
  • Give support staff read-only access

2. Implement Data Validation

Add validation rules to prevent bad data:

  • Email format validation
  • Phone number formatting
  • Required fields
  • Duplicate detection

3. Add Activity Logging

Track all customer interactions:

CREATE TABLE customer_activities (
  id SERIAL PRIMARY KEY,
  customer_id INTEGER REFERENCES customers(id),
  activity_type VARCHAR(50),
  description TEXT,
  user_email VARCHAR(255),
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

4. Create Dashboard Views

Add summary statistics:

  • Total customers by status
  • New customers this month
  • Customers needing follow-up
  • Revenue pipeline (if tracking deals)

5. Set Up Automated Workflows

Use Retool Workflows to automate:

  • Follow-up reminders
  • Status change notifications
  • Data enrichment from external APIs

Common Mistakes to Avoid

Based on our experience building 100+ Retool applications, here are common pitfalls:

1. Not Using Prepared Statements

Always use parameterized queries ({{variable}}) instead of string concatenation to prevent SQL injection.

2. Loading Too Much Data

Don't load all customers at once. Use pagination and lazy loading for better performance.

3. Ignoring Mobile Experience

Many sales teams work on mobile. Test your CRM on mobile devices and adjust the layout accordingly.

4. Not Backing Up Data

Always have a backup strategy. Use your database's built-in backup features.

Real-World Example: How We Built a CRM for a SaaS Startup

We recently built a CRM for a Series A startup that was struggling with Salesforce's complexity and cost. Their sales team needed:

  • Custom fields for their specific sales process
  • Integration with their product database
  • Real-time notifications when customers took key actions
  • Simple, fast interface

Using Retool, we delivered a fully functional CRM in 2 weeks that:

  • Reduced sales data entry time by 60%
  • Cost 80% less than their Salesforce subscription
  • Increased sales team adoption to 100% (vs 40% with Salesforce)

Conclusion

Building a CRM in Retool is one of the best ways to get started with the platform. In just 30 minutes, you can create a functional system that rivals custom-built solutions costing tens of thousands of dollars.

The key is to start simple and iterate based on your team's feedback. Add features gradually as you identify needs, rather than trying to build everything at once.

Ready to Build Your Own Retool CRM?

If you need expert help building production-ready Retool applications, our team is here to help. We've built 100+ internal tools for companies worldwide.

🚀 Need Expert Help? Our team has built 100+ CRMs and internal tools for companies worldwide. Schedule a free consultation to discuss your CRM needs, or calculate your potential ROI with our free tool.

💰 Limited Offer: Book this week and get 10% off your first Retool project!

Want to learn more? Check out our Custom App Development services or explore how we help companies optimize and rescue existing Retool apps.

FAQs

How much does it cost to build a CRM in Retool?

Retool's platform costs start at $10/user/month. If you build it yourself, that's your only cost. If you hire our team, we can build a production-ready CRM in 1-2 weeks for $5,000-$15,000 depending on complexity.

Can Retool scale for large companies?

Yes. Retool is used by companies like Amazon, NBC, and DoorDash. It can handle thousands of users and millions of records with proper database optimization.

What databases work with Retool?

Retool supports PostgreSQL, MySQL, MongoDB, MS SQL Server, Oracle, Google Sheets, Airtable, Snowflake, and 50+ other data sources.

Do I need coding experience?

No. Basic SQL knowledge is helpful but not required. We provide examples and templates to get you started.

How long does it really take?

For a basic CRM with customer list, detail view, and CRUD operations, expect 2-4 hours. For a production-ready system with advanced features, plan for 1-2 weeks.

Need Help Building Your Retool Application?

Our team of experts can help you build production-ready internal tools in 2-3 weeks. We've built 100+ applications for companies worldwide.

Related Articles