Base44 database

Database Relationship and Foreign Key Errors in Base44

Your Base44 app uses related database tables (for example, a Users table linked to an Orders table), but the relationships are not working correctly. Related records don't appear in linked views, creating a record in one table doesn't properly reference the related record in another, or deleting a record causes unexpected cascade effects.

This issue often manifests as dropdown selectors for related records showing empty lists, detail pages failing to display linked data, or errors when trying to create records that reference other tables.

Relationship issues can be subtle and may only appear with certain data combinations or when the related tables grow beyond a small number of records.

Error Messages You Might See

Referenced record not found Foreign key constraint violation Cannot delete record: referenced by other records
Referenced record not foundForeign key constraint violationCannot delete record: referenced by other records

Common Causes

  1. The relationship field type is incorrectly configured (e.g., using a text field instead of a proper reference/relation field)
  2. The referenced record was deleted but the foreign key reference still exists, creating orphaned records
  3. The relationship direction is inverted: the link field is on the wrong table
  4. The relation field references the wrong column (e.g., referencing a name field instead of the unique ID)

How to Fix It

Review your table schemas and ensure that relationship fields use Base44's proper relation/reference field type, not a plain text or number field storing IDs manually. The built-in relation type handles the linking automatically.

Check the direction of the relationship: a one-to-many relationship (e.g., one User has many Orders) requires the link field on the "many" side (Orders), not on the "one" side (Users).

For existing apps with broken relationships and orphaned records, a developer can help clean up the data and reconfigure the schema correctly without losing existing records.

Real developers can help you.

Franck Plazanet Franck Plazanet I am a Strategic Engineering Leader with over 8 years of experience building high-availability enterprise systems and scaling high-performing technical teams. My focus is on bridging the gap between complex technology and business growth. Core Expertise: šŸš€ Leadership: Managing and coaching teams of 15+ engineers, fostering a culture of accountability and continuous improvement. šŸ—ļø Architecture: Enterprise Core Systems, Multi-system Integration (ERP/API/ETL), and Core Database Structure. ā˜ļø Cloud & Scale: AWS Expert; architected systems handling 10B+ monthly requests and managing 100k+ SKUs. šŸ“ˆ Business Impact: Aligning tech strategy with P&L goals to drive $70k+ in monthly recurring revenue. I thrive on "out-of-the-box" thinking to solve complex technical bottlenecks and am always looking for ways to use automation to improve business productivity. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. legrab legrab I'll fill this later PawelPloszaj PawelPloszaj I'm fronted developer with 10+ years of experience with big projects. I have small backend background too Matt Butler Matt Butler Software Engineer @ AWS Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Why don't my linked records show up in Base44?

Make sure you're using Base44's relation field type, not a plain text field. The relation field type automatically handles the linking and display of related records.

How do I fix orphaned records in Base44?

Orphaned records occur when a referenced record is deleted. You may need to clean up the orphaned references manually or set up cascade rules to handle deletions automatically.

Related Base44 Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help