--- title: "CopyDownFromTemplate" slug: "copydownfromtemplate" updated: 2023-11-15T17:27:46Z published: 2023-11-15T17:27:46Z canonical: "docs.datajet.app/copydownfromtemplate" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # CopyDownFromTemplate Copies fields in specified field template from primary table to foreign table | Key | Value(s) | Description | | --- | --- | --- | | method | "CopyDownFromTable" | Copies fields in specified field template from primary table to foreign table | | targetTable | "TableToCopyFieldsTo" | The name of the FOREIGN TABLE | | template | "FieldTemplateName" | The name of the [template](/v1/docs/template-collection) on the PRIMARY TABLE | | overwrite | true/false | If true, existing fields will be overwritten | | dataset{} | {} | Dataset of records to copy. | | prefix | "Prefix" | Optional. If provided, new fields will be prefixed with this value. | | project | "Project name" | | #### JSON ```json { "method": "CopyDownFromTemplate", "project": "", "targetTable": "framingham", "template": "fi-all", "prefix": "MODEL1_", "overwrite": false, "dataSet": { "logic": "or", "name": "framingham_individual", "strict": true, "set": [ { "logic": "or", "stype": "TABLE", "entity": "framingham_individual" } ] } } ``` Right-click in the JSON window and choose from existing templates: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1700068218448.png) #### Template: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1700068346610.png) #### Source Table (Primary Table containing the template): (Note this is primary to the other table, framingham ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1700068412406.png) #### Target Table: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1700068448777.png)