LogoLogo
HomepageYouTube ChannelInstall from the AppExchange
  • Home
  • Dynamic Components
  • Flow Components
  • Experience Components
  • Projects
  • 👋Welcome
  • Getting Started
    • Product Tour
    • Quickstart Tutorial
    • Understanding The Essentials
      • Component Builder
      • Component Visibility
      • Target Page Object
      • Using Variables and Component Data
      • Publishing your Dynamic Components
      • Dynamic vs. Flow Components
    • Avonni Components App
      • Accessing the App
      • Folders
      • Templates
      • Version management
    • AppExchange Listing Page
    • Installation & Licenses Management
  • Tutorials
    • Projects
    • Components
      • Calendar
        • How to Create Events Quickly by Dragging
        • How to Add an Edit Action to Calendar Events
        • How to Add a New Event Button to the Calendar Header
        • How to Customize the Right-Click Menu
        • How to Reschedule Events with Drag and Drop
      • Columns
        • Creating a Responsive 3-Column Layout
      • Data Table
        • How to customize Data Table style
        • How to make a field editable
        • How to add clickable buttons
        • How to color-code badges
        • How to export data
        • How to configure search
        • How to set columns visibility
      • Kanban
        • Saving Changes on Drag-and-Drop
      • List
      • Metric
      • Record Detail
        • Saving Changes
    • Interactions
      • How to create an interaction to navigate to an object page
      • How to create an interaction to navigate to a record page
      • How to Pass Multiple Selected Records from a Dynamic Component to a Screen Flow
    • Reactive Components
      • Reactive Map and Data Table
      • Master-Detail Relationship with Data Tables
      • Vertical Tabs with Reactive Data Table
    • Style
      • How do you add space or a break between sections or fields?
    • Tips and Tricks
      • Using the Dynamic Component component
  • Component Builder
    • Overview
    • Configuring Components
      • Properties
      • Fields
      • Style
    • Data & Interactions
      • Data Sources
        • Manual
        • Picklist
      • Resources
        • Constant
        • Formula
        • Nested Queries
        • Query
        • Variable
      • Interactions
        • CRUD from Record Variable
        • Download
        • Execute Flow
        • Navigate
        • On Load
        • Open Alert Modal
        • Open Confirm
        • Open Dynamic Component Dialog
        • Open Dynamic Component Panel
        • Open Flow Panel
        • Open Flow Dialog
        • Show Toast
    • Advanced Topics
      • Undo / Redo
      • Copy and Paste
      • Keyboard Shortcut
  • Components
    • Explore All Components
    • Accordion
    • Alert
    • Audio Player
    • Avatar
    • Avatar Group
    • Badge
    • Barcode
    • Blockquote
    • Button
    • Button Group
    • Button Icon
    • Button Menu
    • Button Stateful
    • Calendar
    • Camera 🆕
    • Card
    • Carousel
    • Chart
    • Checkbox
    • Checkbox Button
    • Chip Container
    • Color Picker
    • Columns
    • Combobox
    • Container
    • Counter
    • Data LWC Container
    • Data Table
    • Date Picker
    • Date
    • Date Range
    • Dual Listbox
    • Dynamic Component
    • Formatted Address
    • Formatted Name
    • Formatted Value
    • Header
    • Icon
    • Icon Picker
    • Illustration
    • Image
    • Input Color
    • Input Date
    • Input Pen (Signature)
    • Input Text
    • Kanban
    • List
    • LWC Container
    • Map
    • Media Object
    • Metric
    • PDF Viewer
    • Pivot Table
    • Progress Bar
    • Progress Circle
    • Progress Indicator
    • Rating
    • Record Detail
    • Relationship Graph
    • Scope Notification
    • Section
    • Separator
    • Slider
    • Status
    • Tabbed Container
    • Tabs
    • Text
    • Text Area
    • Timeline
    • Toggle
    • Tree
    • Vertical Visual Picker
    • Video Player
    • Visual Picker
    • Visual Picker Link
  • Help
    • Contact Support
    • Security
    • Performance Guide
    • Deployment Process
    • Release Notes
    • Report Bugs
Powered by GitBook
LogoLogo

Company

  • About Us
  • Pricing

Policies

  • Privacy Policy
  • Terms of Service
On this page
  • Overview
  • Guided Steps
  • Step 1: Set Up the Accounts Data Table (Master)
  • Step 2: Set Up the Contacts Data Table (Detail)
  • Step 3: Create the Reactive Filter
  • Step 4: Test the Reactivity

Was this helpful?

  1. Tutorials
  2. Reactive Components

Master-Detail Relationship with Data Tables

Last updated 2 months ago

Was this helpful?

Overview

This tutorial demonstrates how to create a classic master-detail relationship between two Avonni components. You'll build a component where:

  • One Data Table (the "master") displays a list of Accounts.

  • A second Data Table (the "detail") displays Contacts related to the currently selected Account.

Setting up a reactive filter on the detail table's data source is key. This filter dynamically updates based on the selected row in the master table, ensuring that only the relevant Contacts are displayed. This creates a seamless and interactive user experience.

We will be following those steps:

  • Set up the account table, also called the master table.

  • Set up the contact table, the details one.

  • Create the reactive filter to link those two tables.

  • Test

Guided Steps

Step 1: Set Up the Accounts Data Table (Master)

  1. Add an Avonni Data Table component to your page.

  2. Configure its data source to display a list of Accounts (using a Query).

Step 2: Set Up the Contacts Data Table (Detail)

  1. Add another Avonni Data Table component to your page.

  2. Configure its data source to display Contacts (using the Avonni Query Data Source).

Handy Tip

Step 3: Create the Reactive Filter

  1. Add a Filter Condition:

    • Field: Select the AccountId field on the Contact object (or the field linking Contacts to Accounts).

    • Operator: Choose equals.

    • Value: Do not enter a fixed value. Instead, reference the selected Account's ID:

      !AccountsTable.firstSelectedRow.Id
      • Explanation:

        • !AccountsTable: Your Accounts Data Table component (use the API name).

        • .firstSelectedRow: The currently selected row in the Accounts table.

        • .Id: The Id field from that selected row.

    • Make sure to use the correct names for the component and field.

Step 4: Test the Reactivity

  1. Preview your page.

  2. Select different Accounts in the Accounts Data Table. The Contacts Data Table should automatically update.

You can use a to display your two data tables side by side.

column component
Data Table