# Interactions

## Overview

Interactions define the logic and behavior of your Dynamic Components. They determine how the application responds when users engage with the interface—whether clicking a button, selecting a row, or loading a page.

Using the no-code builder, you can define complex behaviors following a simple Event-Driven Pattern:

> Trigger *(e.g., On Click)* $$\rightarrow$$ Action *(e.g., Navigate)* $$\rightarrow$$ Result *(e.g., Opens Page)*

***

## How to Configure Interactions

1. **Select Component**: Open your Dynamic Component and click on the specific element (e.g., Button, Data Table) you wish to make interactive.
2. **Access Interactions**: Navigate to the Interactions tab in the right-hand Properties Panel.
3. **Choose Trigger**: Select the event that starts the sequence (e.g., *On Click*, *On Row Action*, *On Load*).
4. **Add Action**: Click Add Action and select the desired interaction type from the library below.
5. **Chain Actions** (Optional): You can add multiple actions to a single trigger. They will execute sequentially (e.g., *Update Record* $$\rightarrow$$ *Show Toast* $$\rightarrow$$ *Close Modal*).

<figure><img src="/files/98LAGC7fjUiAL78BabVL" alt="" width="563"><figcaption></figcaption></figure>

💡 **Tip:** Chain multiple actions together for one trigger. They execute in order, letting you create sequences like Execute Flow → Show Toast → Navigate.

***

## Interaction Reference

### Navigation & Feedback

*Guide users to different pages and provide visual feedback on their actions.*

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/5em6ojs9ERshcfkZzvWO"><strong>Navigate</strong></a></td><td>Redirects the user to a Record Page, Object Home, External URL, or another App.</td></tr><tr><td><a href="/pages/qRK2XVJtdMOe1bPxvDqx"><strong>Show Toast</strong></a></td><td>Displays a temporary notification banner (Success, Warning, Error, or Info) at the top of the screen.</td></tr><tr><td><a href="/pages/QWVjNeBlaazYtEEBrP95"><strong>Open Alert Modal</strong></a></td><td>Interrupts the workflow with a critical message that requires user acknowledgment to proceed.</td></tr><tr><td><a href="/pages/UvUrPZvN1WpMi2gAM3AH"><strong>Open Confirm Dialog</strong></a></td><td>Requires the user to confirm or cancel an action (ideal for "Delete" or "Submit" scenarios).</td></tr></tbody></table>

### Dynamic Components

*Open other Dynamic Components within your current page for layered workflows.*

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/szISVdLeZB0qVCa9pdW8"><strong>Open Component Dialog</strong></a></td><td>Opens another Dynamic Component in a modal overlay. Great for wizards or complex forms.</td></tr><tr><td><a href="/pages/JVAMbUAhsdjd7jrj3y95"><strong>Open Component Panel</strong></a></td><td>Opens another Dynamic Component in a sliding side panel.</td></tr></tbody></table>

### Flows

*Integrate Salesforce Flows to execute business logic and display guided processes.*

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/AvP1rkPziFUMba331nbv"><strong>Execute Flow</strong></a></td><td>Runs an Autolaunched Flow in the background to perform calculations or data operations.</td></tr><tr><td><a href="/pages/BaQkyQsIc8iM6rVETwlq"><strong>Open Flow Dialog</strong></a></td><td>Launches a Screen Flow inside a modal window (pop-up) over the current page.</td></tr><tr><td><a href="/pages/ZmK73GFojyxXub0RMkti"><strong>Open Flow Panel</strong></a></td><td>Launches a Screen Flow inside a sliding side panel, keeping the main content visible.</td></tr></tbody></table>

### Selected Records Operations

Use these native operations to manage data in bulk directly from the Data Table component without needing to build custom logic.

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/iMWClkPsUUVdiKnCstnu"><strong>Delete Selected Records</strong></a></td><td>Automatically removes one or multiple records from Salesforce after a mandatory user confirmation.</td></tr><tr><td><a href="/pages/ZkST9MBQVn7xvJTKsPo4"><strong>Duplicate Selected Records</strong></a></td><td>Creates exact clones of the selected records in a single backend transaction.</td></tr><tr><td><a href="/pages/XsKxYsWdbIlJjLCsfeGr"><strong>Edit Selected Records</strong></a></td><td>Opens a modal allowing users to select a field and apply a new value to all targeted records.</td></tr></tbody></table>

### Records & Data

*Manage Salesforce records and export data directly from your components.*

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/VURVUXi4CT246B111NDN"><strong>Create Record</strong></a></td><td>Creates a new record in Salesforce using values stored in a record variable.</td></tr><tr><td><a href="/pages/eICv4WV5A8YQGpIEQFnp"><strong>Update Record</strong></a></td><td>Commits changes made to a record variable back to Salesforce.</td></tr><tr><td><a href="/pages/FORMWSyXYxUuTTvvHWpE"><strong>Delete Record</strong></a></td><td>Permanently deletes the record associated with the current record variable.</td></tr><tr><td><a href="/pages/v2EaAjbkwcgrBKtp0HEg"><strong>Get Record</strong></a></td><td>Refreshes or fetches the latest data for a specific record variable from the database.</td></tr><tr><td><a href="/pages/iRF7BT39o7oBiF264Ztb"><strong>Copy Records</strong></a></td><td><em>(Data Table Header Only)</em> Copies selected rows to the clipboard, formatted for pasting into Excel or email.</td></tr><tr><td><a href="/pages/geBDHV208nrBy0PebOv8"><strong>Download</strong></a></td><td>Enables direct file downloading from Data Table content.</td></tr></tbody></table>

### Variables & AI

*Store information and leverage AI capabilities within your components.*

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/zM4ayrYxR0sCCirA4VQJ"><strong>Assignment</strong></a></td><td>Modifies the value of a variable (e.g., Set, Add, Toggle). Used for state management and calculations.</td></tr><tr><td><a href="/pages/FO2Gp0MmC8lwMj7CBXaF"><strong>Invoke AgentForce</strong></a></td><td>Triggers an AI agent to perform tasks like recommendations, summarization, or automated decision-making.</td></tr></tbody></table>

### Other Actions

*Additional specialized interactions for specific use cases.*

<table><thead><tr><th width="198.73046875">Action</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/zLivhMHpUlMPCa9u40f5"><strong>Open Quick Action</strong></a></td><td>Launches a standard Salesforce Quick Action (e.g., Log a Call, New Task).</td></tr><tr><td><a href="/pages/jY4RWK7PtcKRcI4mhwJ2"><strong>Update Location</strong></a></td><td>Captures the device's current geographic coordinates and updates location-based data fields.</td></tr></tbody></table>

***

## Common Patterns

**After updating data:** Always add a "Refresh Query" action to show the latest information.

**Before deleting:** Use "Open Confirm Dialog" to prevent accidental deletions.

**Complex workflows:** Chain actions like Execute Flow → Assignment → Show Toast → Navigate.

**User feedback:** Include Show Toast after important actions to confirm success or explain errors.

***

## Troubleshooting

<details>

<summary><strong>⚠️ My interaction doesn't do anything when I click</strong></summary>

Interactions don't work in the Component Builder's preview. You need to test them on an actual page.

**Here's how to test your interaction properly:**

1. **Save your Dynamic Component** in the builder
2. **Go to a Lightning Page** where you've added this component (like your Account page or Home page)
3. **Refresh the page** to load your latest changes
4. **Try your interaction** - click the button, select a row, etc.

If you haven't added your component to a page yet:

1. Go to Setup → Lightning App Builder
2. Edit a page (or create a new one)
3. Drag your Dynamic Component onto the page
4. Save and activate the page
5. Now go view that page and test your interaction

**Still not working?** Press F12 on your keyboard to open the browser console. Look for red error messages - they'll tell you what's going wrong

</details>

<details>

<summary><strong>↕️ My actions happen in the wrong sequence</strong></summary>

When you add multiple actions to one interaction, they run top-to-bottom in the list.

**To change the order:**

1. Go to the Interactions panel
2. Find your list of actions
3. **Drag and drop** them into the correct order (grab the handle on the left side)
4. Save your component

If actions still seem out of sync, they might be running too fast. Try adding a small delay between them.

</details>

<details>

<summary><strong>↻ My data shows old information after an action</strong></summary>

When you update, create, or delete records, the component doesn't automatically know to refresh what it's displaying.

**The fix:**

1. Open your interaction
2. After your update/create/delete action, click **"Add Action"**
3. Choose **"Refresh Query"**
4. Select which data table or component needs to refresh
5. Save

Now your component will reload the data after making changes, so users see the updated information immediately.

</details>

<details>

<summary><strong>→ My navigation button goes to the wrong place</strong></summary>

Your Navigate action has settings that tell it where to go. One of these is probably incorrect:

**Check these settings:**

* **Page Reference Type**: Are you trying to go to a "Record Page" but selected "Object Home"?
* **Record ID**: If going to a specific record, is this the correct record's ID? (It might be pulling from the wrong field)
* **Object API Name**: Did you type "Account" when you meant "Contact"?

**How to verify:**

1. Click on the interaction in the Interactions panel
2. Review each field in the Navigate configuration
3. Make sure you're using the right variable or field name for Record IDs
4. Test with a record you know exists

Still having issues? Try navigating to a simple test record first to make sure the Navigate action itself works.

</details>

***

## Next Steps

Start with simple interactions like Navigate and Show Toast, then build up to complex sequences as you get comfortable. Each interaction type has detailed documentation with specific examples and configuration options


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/dynamic-components/component-builder/interactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
