# Copy and Paste

The Dynamic Component Builder includes a copy-and-paste feature that allows you to duplicate components *and their configurations* quickly and easily. This significantly speeds up development and ensures consistency across your components.

***

## What Gets Copied?

When you copy a component, you're copying:

* **The Component Type:** (e.g., Data Table, Button, Text, etc.)
* **All Properties:** All settings in the component's Properties Panel (e.g., label, data source, visibility conditions, interactions, styling).
* **Nested Components:** If the component contains *nested* Dynamic Components (using the Dynamic Component component), those nested components and their configurations are also copied.
* **Resources are not copied:** only component configurations are.

***

## Step-by-Step Guide

{% stepper %}
{% step %}

#### **Select the Source Component**

In the Component Builder canvas, click on the Avonni component you want to copy. This will highlight the component and display its properties in the Properties Panel.
{% endstep %}

{% step %}

#### **Copy the Component**

* Locate the **Copy** button in the top-left corner of the Component Builder canvas. It's usually represented by an icon of two overlapping squares or a similar "copy" symbol.
* Click the **Copy** button. This copies the selected component and its configuration to the clipboard.
  {% endstep %}

{% step %}

#### **Paste the Component**

* Locate the **Paste** button in the top-left corner of the Component Builder. It is usally represented by a clipboard icon.
* Click the paste button. A copy of the component is added to the canvas
  {% endstep %}

{% step %}

#### **Place the Component**

* The new component appears
* Click on the **Move** button
* Select the new location for your component.
  {% endstep %}
  {% endstepper %}

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FLfueHdlhgmDs6uMapWy7%2F2025-03-17_09-55-25.png?alt=media&#x26;token=80a248b3-bcef-44ac-9a59-4a989b0334c3" alt=""><figcaption></figcaption></figure>

***

{% hint style="warning" %}

#### Important Considerations

When you copy and paste components, it's important to understand how different elements are handled:

* **Data Sources**
  * **Within the Same Dynamic Component:** If you copy and paste a component *within the same* Dynamic Component, and that component uses a Data Source (e.g., Query, Picklist), the *data source configuration* is copied, *and* the pasted component will be connected to the *same* data source instance. Changes to the data source in one component will affect the other.
  * **Between Different Dynamic Components:** If you copy a component and paste it into a *different* Dynamic Component, the Data Source is *not* copied. You will need to create a new data source manually (or select an existing, compatible one) for the target Dynamic Component and configure it appropriately.
* **Interactions**
  * **Within the Same Dynamic Component:** Interactions (e.g., "On Click" actions) *are* copied along with the component. Suppose the interaction references other components or resources within the same Dynamic Component (using their API Names). In that case, those references will generally work correctly *if* the referenced components/resources also exist in the pasted location. You may need to adjust references if names are not unique.
  * **Between Different Dynamic Components:** Interactions *are* copied. However, any references to other components or resources within the *original* Dynamic Component will likely *break*. You will need to manually update these references in the pasted component to point to the correct components/resources in the *target* Dynamic Component.
* **Resources**
  * **Within the Same Dynamic Component:** Resources are *not* automatically copied when you paste a component *within* the same Dynamic Component. If the pasted component relies on resources, you have to make sure those resources exist.
  * **Between Different Dynamic Components:** Resources are *never* copied between Dynamic Components. You must manually recreate any required resources (Variables, Constants, Formulas) in the target Dynamic Component.
    {% endhint %}

## Summary

| Element          | Within Same Dynamic Component                       | Between Different Dynamic Components                |
| ---------------- | --------------------------------------------------- | --------------------------------------------------- |
| **Component**    | Copied (including properties and nested components) | Copied (including properties and nested components) |
| **Data Source**  | Configuration copied, same instance used            | Not copied; must be recreated/reselected            |
| **Interactions** | Copied, references may need adjustment              | Copied, references likely need adjustment           |
| **Resources**    | Not copied; must exist.                             | Not copied; must be recreated                       |
