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
  • How it Works
  • Use Cases
  • Example: Reusable Related Contacts
  • Performance Considerations

Was this helpful?

  1. Components

Dynamic Component

The Avonni Dynamic Component component lets you embed one Dynamic Component within another.

The Dynamic Component component is a container component allowing you to embed other Avonni Dynamic Components. This is the key to creating reusable components and building complex, hierarchical layouts in Avonni Dynamic Components. Think of it as a way to insert a pre-built component (or a section of a component) into another component.

Overview

The Dynamic Component component doesn't display data or provide direct interactivity. Instead, it acts as a placeholder for another Dynamic Component. This offers several crucial benefits:

  • Reusability: Build a complex UI element (e.g., a custom related list, a specialized form, a mini-dashboard) once as a separate Dynamic Component. Then, use the Dynamic Component component to embed that pre-built component in multiple places – on different record pages, app pages, or even within other Dynamic Components.

  • Modularity: Break down large, complex components into smaller, more manageable pieces. This makes your components easier to understand, maintain, and update.

  • Organization: Create a clear hierarchical structure for your UI, grouping related elements logically.

  • Encapsulation: The internal workings of the nested component are hidden from the parent component. This reduces complexity and prevents naming conflicts.

How it Works

  1. Create the "Child" Component: First, you create the Dynamic Component that you want to embed (the "child" component). This regular Dynamic Component is built with any combination of Avonni components. Define any input and output variables you need to communicate with the parent component.

  2. Add the Dynamic Component Component: In your "parent" Dynamic Component (where you want to embed the child), drag a Dynamic Component component from the Component Library onto the canvas.

  3. Select the Component to Display: In the Properties Panel of the Dynamic Component component, you'll find a setting (labeled "Name"). Use the component selector to choose the name of the Dynamic Component you created in step 1.

Use Cases

  • Reusable Related Lists: Create a custom "Related Contacts" component once, and then use the Dynamic Component component to embed it on Account, Opportunity, or other record pages. Pass the parent record's ID as an input variable to filter the related list.

  • Custom Forms: Build specialized forms as separate Dynamic Components, then embed them in other components as needed.

  • Mini-Dashboards: Create small, self-contained dashboards (e.g., a chart and a summary table) as Dynamic Components, then embed them in more extensive dashboards or record pages.

  • Complex Layouts: Break down a complex page layout into smaller, more manageable sections, each implemented as a separate Dynamic Component.

  • Conditional Sections: Use a Dynamic Component component combined with visibility rules to show/hide entire sections of your UI based on conditions.

Example: Reusable Related Contacts

  1. Create "RelatedContacts" Component:

    • Create a new Dynamic Component named RelatedContacts.

    • Set its Target Object API Name to Account (assuming you'll use this on Account pages).

    • Add a Data Table component to display Contacts.

    • Configure the Data Table's query to retrieve Contacts related to an Account. Use a filter: AccountId equals {!inputAccountId}.

    • Create a Text Variable resource named inputAccountId and mark it as Available for Input. This will receive the Account ID from the parent component.

    • Save and Activate RelatedContacts.

  2. Create "AccountDetailPage" Component:

    • Create another Dynamic Component named AccountDetailPage.

    • Set its Target Object API Name to Account.

    • Add any components you want to display Account details.

  3. Embed "RelatedContacts":

    • In AccountDetailPage, drag a Dynamic Component component onto the canvas.

    • In the Dynamic Component component's properties, select RelatedContacts as the component to display.

    • You'll now see the inputAccountId input variable listed. Bind this to $Component.record.Id. This passes the current Account's ID to the nested component.

  4. Add to Account Page: Add the AccountDetailPage component to an Account record page.

Now, on any Account record page, the AccountDetailPage component will be displayed. It will, in turn, embed the RelatedContacts component, passing the current Account's ID to it. The RelatedContacts component will use that ID to filter its Data Table and display the related Contacts.

Performance Considerations

While nested components offer great flexibility, excessive or poorly designed nesting can impact performance. Here are some tips:

  • Avoid Deep Nesting: Limit the levels of nesting. Very deep hierarchies can be harder to manage and can slow down rendering.

  • Use Input/Output Variables: Pass data between parent and child components using input/output variables instead of having each nested component fetch its own data independently.

  • Conditional Visibility: Use visibility rules to prevent unnecessary components from loading.

  • Monitor Data Loading: Be mindful of how data is loaded within nested components. Avoid redundant queries.

Last updated 2 months ago

Was this helpful?