LogoLogo
HomepageYouTube ChannelInstall from the AppExchange
  • Home
  • Dynamic Components
  • Flow Components
  • Experience Components
  • Projects
  • 👋Welcome
  • Getting Started
    • Product Tour
    • Quickstart Tutorial
    • Avonni Components App
      • Accessing the App
      • Folders
      • Templates
      • Version management
    • Understanding The Essentials
      • Component Builder
      • Component Visibility
      • Target Page Object
      • Using Variables and Component Data
      • Publishing your Dynamic Components
      • Dynamic vs. Flow Components
    • 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
    • File Upload
    • 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
  • Using Variables and Component Data
  • How to Access Data: The Resource Selector
  • Accessing Global Variables
  • Accessing Your Resources (Variables, Constants, Formulas)
  • Accessing Attributes from Other Components (Key to Reactivity)
  • Practical Examples
  • Example 1: Displaying the Current User's Name
  • Example 2: Controlling Visibility with a Combobox
  • In Summary

Was this helpful?

  1. Getting Started
  2. Understanding The Essentials

Using Variables and Component Data

Last updated 1 month ago

Was this helpful?

Using Variables and Component Data

Avonni Dynamic Components allow you to easily access various data types to make your components truly dynamic and responsive. This includes system-provided Global Variables, your defined Resources (Variables, Constants, Formulas), and Attributes from Other Components on your canvas. Understanding how to access this data is key to building powerful interactions and interfaces.

How to Access Data: The Resource Selector

The primary way you access any of these data types within the Component Builder is through the Resource Selector. This is the small icon (often resembling { }, a tag, or a variable symbol) located next to many properties in the Properties Panel, filter configurations, and interaction settings.

When you click the Resource Selector, you'll typically see options to choose from:

  • Global Variables (usually starting with $)

  • Your defined Resources (Variables, Constants, Formulas - usually referenced like {!YourResourceName})

  • Component Attributes (allowing you to reference other components using @ComponentName.attribute)

Accessing Global Variables

Global Variables provide ready-made information about the context your component is running in. You select them via the Resource Selector.

Key global variables include:

  • $Api: Provides information related to Salesforce APIs. (Used in advanced scenarios).

  • $Component: Provides context specific to the Dynamic Component itself.

    • $Component.record: When the Target Object API Name is set and the component is on a record page, this crucial variable holds the entire current record's data. You access fields using dot notation (e.g., $Component.record.Name, $Component.record.Industry).

    • $Component.recordId (or @recordId via Resource Selector): When the Target Object API Name is set and the component is on a record page, this directly provides the current record's 15- or 18-character ID. Very useful for filters or passing to interactions.

  • $Organization: Provides details about the current Salesforce organization (e.g., $Organization.Id, $Organization.Name).

  • $Profile: Provides details about the current user's Salesforce Profile (e.g., $Profile.Id, $Profile.Name). Useful for controlling visibility based on profile.

  • $System: Provides system-related information (availability may vary, check specific contexts).

  • $User: Provides details about the currently logged-in user.

    • Examples: $User.Id, $User.FirstName, $User.LastName, $User.Email, $User.Username. Useful for personalization, filtering data ("My Records"), or conditional logic.

Accessing Your Resources (Variables, Constants, Formulas)

You can easily use the Variables, Constants, and Formulas you create in the Resources Panel:

  • How: Click the Resource Selector next to a property, filter value, or interaction input. Select the desired Variable, Constant, or Formula resource from the list.

  • Syntax (Displayed): The builder will typically display the reference like {!YourResourceApiName}.

  • Use Cases: Displaying calculated values, storing user input, setting default values, controlling visibility, using in filters, passing data to interactions.

Accessing Attributes from Other Components (Key to Reactivity)

This is how you make components interact dynamically:

  • How: Click the Resource Selector. Choose the Component Attribute option.

  • Select Component: Choose the other component on your canvas that you want to get data from.

  • Select Attribute: Choose the specific attribute of that component whose value you need (e.g., .value for input components, .firstSelectedRow for Data Tables, activeItemValue for Tabs).

  • Syntax (Displayed): The builder will typically display the reference like @ComponentApiName.attributeName (e.g., @MyCombobox.value, @AccountsTable.firstSelectedRow.Id).

  • Use Cases: Creating reactive filters (filtering Data Table B based on selection in Data Table A), updating display components (showing text based on a Combobox selection), controlling visibility based on another component's state.

Practical Examples

Example 1: Displaying the Current User's Name

  1. Add a Text component.

  2. In its Value property, click the resource selector.

  3. Select Global Variable.

  4. Select $User.

  5. Select FirstName. (The value might show as $User.FirstName).

  6. Add another Text component.

  7. In its Value, use the resource selector to choose Global Variable > $User > LastName.

  8. You could also use a formula {!$User.FirstName} & " " & {!$User.LastName}

Example 2: Controlling Visibility with a Combobox

Imagine you have a combobox that allows users to select a status ('Active' or 'Inactive'). You want to show a "Reactivate" button only when 'Inactive' is selected.

  1. Add Combobox: Add an Avonni Combobox. Give it an API Name (e.g., StatusSelector). Configure its options (Label/Value: Active/active, Inactive/inactive).

  2. Add Button: Add an Avonni Button. Set its Label to "Reactivate".

  3. Set Button Visibility: Select the Button. In the Visible property, click the resource selector:

    • Choose Component Attribute.

    • Component: Select your Combobox (StatusSelector).

    • Attribute: Select value.

    • Operator: Set to equals.

    • Value: Enter the text inactive (matching the combobox option value).

Now, the "Reactivate" button only appears when "Inactive" is selected in the Combobox.

In Summary

Avonni Dynamic Components provide flexible access to global context, your defined resources, and the state of other components via the resource selector. Mastering this allows you to build highly dynamic, interactive, and data-aware user interfaces without code