clone_instrument
Clone a REDCap instrument by copying all fields into a new form, prefixing each field name to avoid collisions, and clearing branching logic for you to update manually.
Instructions
Clone all fields of an instrument into a new instrument.
Each cloned field name is prefixed with field_prefix to avoid collisions. Branching logic is cleared on cloned fields because it references the original field names; update it manually with update_field after cloning.
Args: source_form: Internal name of the instrument to clone. new_form_name: Internal name for the new instrument. field_prefix: Prefix to prepend to every cloned field name (e.g. 'v2_' turns 'age' into 'v2_age').
Returns: Confirmation message with the count of cloned fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_form | Yes | ||
| field_prefix | Yes | ||
| new_form_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |