# tSetDynamicSchema

Sets a dynamic schema that can be reused by components in the subsequent subJob or subJobs to retrieve data from unknown columns.

tSetDynamicSchema creates a dynamic schema to allow components that are unable to guess the structure of the data being handled based on field separators, such as tFileInputPositional and tFileOutputPositional, to retrieve data from unknown columns.

## tSetDynamicSchema Standard properties

These properties are used to configure tSetDynamicSchema running in the Standard Job framework.

The Standard tSetDynamicSchema component belongs to the Custom Code family.

The component in this framework is available in all subscription-based Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit<br>schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br><br>Built-In: You create and store the schema locally for this component<br>only.<br><br><br>Repository: You have already created the schema and stored it in the<br>Repository. You can reuse it in various projects and Job designs.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul><br><br>This option is not available if you select the Guess schema from<br>file option or the Read schema from file<br>option. |
| Sync columns | Click to synchronize the output file schema with the<br>input file schema. The Sync function is available only when the<br>component is linked with an input component using a Row connection. |
| Guess schema from file | Select this option to generate the schema from a csv file. You need to enter<br>the path to the csv file in the<br>Filename field manually or by clicking the [...]<br>button and navigating to the csv file.<br><br>This option is not available if the component is linked with an input component<br>using a Row connection or if you select the<br>Read schema from file option. |
| Read schema from file | Select this option to generate the schema from a schema definition file. You need to enter the<br>path to the schema definition file in the Filename field<br>manually or by clicking the [...] button and navigating to the file.<br><br>Information noteNote:<br><br><ul> <li>A schema definition file needs to be a <span>csv</span> file. </li> <li>A schema definition file contains a header line and multiple column                           definitions, with each column definition occupies one line in the file.                           It can contain column definitions of multiple tables.</li> <li>The header line contains multiple fields. The value of a field can only                           be an option of the <span>Property</span> drop-down list in the                              <span>Parameters</span> table (case sensitive).</li> <li>When the schema of this component is used by a tSAPTableInput component,                           the value of a <span>ExtendedConfiguration</span> field needs                           to be in the format of                              <kbd>{"TableName":"{your_table_name}"}.</kbd> </li> <li>This option is available only when you have installed the 8.0.1-R2022-04                              <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> </ul><br><br>This option is not available if the component is linked with an input component<br>using a Row connection or if you select the<br>Guess schema from file option. |
| Parameters | This table contains two columns.<br><br><ul> <li> <span>Property</span>: Property of the schema                        entry: <kbd>ColumnName</kbd>, <kbd>DBName</kbd>,                           <kbd>Type</kbd>, <kbd>DBType</kbd>,                           <kbd>Length</kbd>, <kbd>Precision</kbd>,                           <kbd>Nullable</kbd>, <kbd>Key</kbd>, or                           <kbd>ExtendedConfiguration</kbd>.</li> <li> <span>Value</span>: Value assigned to this                                property.</li> </ul><br><br>This option is not available if you select the Guess schema from<br>file option or the Read schema from file<br>option.<br><br>Information noteNote:<br><br><ul> <li>The <kbd>ExtendedConfiguration</kbd> property is available                           only when you have installed the 8.0.1-R2022-04 <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> <li>The use of the <kbd>ExtendedConfiguration</kbd> property                           varies with the component that uses the schema of this component. When                           used with a tSAPTableInput component, this property holds table names and                           the value needs to be in the format of                              <kbd>{"TableName":"{your_table_name}"}</kbd>.</li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Row limit | Specify the number of rows in the csv file to guess schema from.<br><br>This field is available if you select the Guess schema from file option in the Basic settings<br>view. |
| tStatCatcher Statistics | Select this check box to gather the Job processing metadata at a<br>Job level as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | DYNAMIC: the last row of the data retrieved using the defined dynamic<br>schema. This is an After variable and it returns a dynamic.<br><br><br>ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component can be used as the end component or be<br>used independently in a subJob. |
| Limitation | To work with tSetDynamicSchema, components should have the<br>option of Use existing dynamic,<br>which allows you to select the tSetDynamicSchema component from the list. |

**Related concepts**

* [Handling a positional file based on a dynamic schema](https://help.qlik.com/talend/en-US/components/8.0/dynamic-schema/tsetdynamicschema-tfileinputpositional-tfileoutputpositional-tfixedflowinput-handling-positional-file-based-on-dynamic-schema-standard-component-enterprise-this)