cloneDuplicate Selected Records

Overview

The Duplicate Selected Records interaction allows users to quickly clone one or multiple records directly from the Data Table. This feature eliminates the need for manual data entry when creating similar records, processing the duplication in a single backend transaction for maximum efficiency.

Prerequisites

The Duplicate Selected Records operation is exclusive to the Data Table component. The interaction relies on the table’s ability to capture specific record IDs from the user's selection to perform the cloning process in Salesforce.


How to Configure Duplicate Selected Records

Follow these steps to enable cloning capabilities within your Data Table.

1. Enable Selection

To duplicate multiple records at once, the component must be able to identify the user's selection.

  • Enable Row Selection: In the Data Table property editor, ensure "Hide Checkboxes" is unchecked. This enables the selection column required for bulk duplication.

2. Choose Your Interaction Placement

The behavior of the Duplicate Selected Records operation depends on where the interaction is placed:

Placement
Behavior
Requirement

Header Action

Mass Duplicate: Clones all records currently checked/selected by the user.

Checkboxes must be enabled.

Row Action

Single Duplicate: Clones only the specific record where the action was clicked.

Does not require checkboxes.

3. Create and Configure the Interaction

Once you have defined your Header or Row actions in the Properties panel, assign the duplication logic:

  1. Navigate to Interactions: Open the Interactions tab in the component builder.

  2. Select Your Action:

    • For Bulk Duplication: Click on the Add Header Action Click (using the header action you created).

    • For Single Record Duplication: Click on the Add Row Action Click (using the row action you created).

  3. Assign the Operation:

    • Type: In the operation dropdown, search for and select Duplicate Selected Records.

    • Target: Ensure the target matches the specific Header or Row action name.

4. Post-Action Configuration (Optional)

To ensure the user sees the newly created records immediately:

  • On Success: It is highly recommended to add a Refresh All Queries interaction. This ensures the table reloads and displays the new cloned records. You should also add a Show Toast notification to confirm that the records were successfully duplicated.

  • On Error: Add a Show Toast notification with the "Error" variant to display any Salesforce-side issues (such as duplicate rules or validation errors) to the user.


User Experience

When the feature is active, the end-user workflow is as follows:

  1. Select: The user checks the boxes for the records they wish to clone.

  2. Trigger: The user clicks the Duplicate button in the header (or the specific row action).

  3. Confirm: The system processes the duplication.

  4. Refresh: The table updates to show the new duplicate records alongside the originals.


Technical Details & Limits

  • Automatic ID Collection: The component automatically gathers the IDs of all selected rows and handles the cloning logic—no manual ID mapping is required.

  • Transaction Efficiency: Even when duplicating many records at once, the operation is handled in a single transaction to respect Salesforce governor limits.

  • Validation & Duplicate Rules: This interaction respects your Salesforce configuration. If a record fails a Duplicate Rule or Validation Rule, the duplication will fail, and the specific error message will be captured and can be displayed via a "Show Toast" interaction

Last updated

Was this helpful?