Skip to main content

Copy Array

This node creates a deep copy of an array, generating new IDs for all items.

The Copy Array node duplicates a collection so it can be modified independently.

The Copy Array node takes a source array and creates a completely new array containing copies of the original items. Crucially, it generates new Object IDs for every item. This means modifying the copied items will not affect the original items.

Inputs

General

DataDescription
Source ItemsThe array to copy.

Actions

SignalDescription
DoTriggers the copy operation.

Outputs

General

DataDescription
Copied ItemsThe new array with copied items.
Copy IdThe ID of the new array.
Original IdThe ID of the source array.
CountNumber of items in the copy.

Events

SignalDescription
DoneTriggered when the copy is complete.

Usage

Use this when you need to edit a list without changing the master version, such as "Edit Order" or "Duplicate Project".

Example Use Cases

  1. Editing a Record:
    • User selects an item from a master list.
    • Copy Array (or Copy Object if available) to create a draft.
    • User edits the draft.
    • On "Save", you overwrite the original; on "Cancel", you discard the draft.
  2. Templates:
    • Have a "Template Project" (Static Array).
    • When user creates a new project, Copy Array from the template to give them their own independent version.

Detailed Behavior

  1. Deep Copy: Properties of the objects are copied.
  2. New IDs: Every object gets a fresh UUID. This breaks the link to the original data model.
  3. Reactivity: The node listens to changes on the new collection, updating outputs if the copy changes.

Troubleshooting

  • Changes affecting original: If this happens, you likely didn't use Copy Array, or you are copying an array that contains references to other objects (nested objects might not be deep-copied depending on depth). This node performs a shallow copy of the object properties, but assigns new IDs.