# tWriteJSONField Standard properties

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

The Standard tWriteJSONField component belongs to the Processing family.

The component in this framework is available in all Talend products.

## Basic settings

| Output Column | Select the column from the list for holding the JSON string<br>generated. The columns in the list are defined in the output schema. |
| --- | --- |
| Configure JSON Tree | Opens the interface to create the JSON data<br>structure. For more information, see [Configuring a JSON Tree](https://help.qlik.com/talend/en-US/components/7.3/processing/configuring-a-json-tree). |
| Schema and Edit 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>Information noteNote: In the output schema, a column is null by default; only the column selected<br>from Output Column holds the JSON string generated. You<br>can add rows in the Group by table and specify other<br>output columns to hold Group-by values.<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. 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> |
|  | Built-In: You create and store the schema locally for this component<br>only. |
|  | Repository: You have already created the schema and stored it in the<br>Repository. You can reuse it in various projects and Job designs. |
| Sync columns | Click to synchronize the output file schema<br>with the input file schema. The Sync function only displays once the Row<br>connection is linked with the output component. |
| Group by | Define the aggregation set, the columns you<br>want to use to regroup the data.<br><br>Information noteWarning:<br><br>Make sure that the data to be grouped is in<br>sequential order. |
| Remove root node | Select this check box to remove the root node<br>from the JSON field generated. |

## Advanced settings

| Quote all not-null<br>values | Select this check box to surround all values including number<br>and boolean values in the generated JSON field with double quotation marks.<br><br>Clear this check box to surround only string values in the<br>generated JSON field with double quotation marks. |
| --- | --- |
| Quote also null values | Select this check box to surround all the strings with the value of null<br>in the generated JSON field with double quotation marks.<br><br>This option is available when Quote all not-null values is<br>selected. |
| tStatCatcher Statistics | Select this check box to gather the Job<br>processing metadata at a Job level as well as at each component level. |

## Global Variables

| Global Variables | ERROR\_MESSAGE: the error message generated by the component when an<br>error occurs. This is an After variable and it returns a string. This variable functions<br>only if the Die on error check box<br>is cleared, if the component has this check<br>box.<br><br><br>NB\_LINE: the number<br>of rows read by an input component or transferred to an output component. This is an<br>After variable and it returns an integer.<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<br>variable, press Ctrl + Space to<br>access the variable list and choose the variable to use from it.<br><br>For further information about variables, see *Talend Studio*<br>*User Guide*. |
| --- | --- |

## Usage

| **Usage rule** | Preceded by an input component, this component<br>wraps the incoming data into a JSON field. |
| --- | --- |

Information noteNote: For any field with the null value, this component writes a pair of square brackets ([]). If needed, you can remove or replace them using a regular expression in a tJavaRow component next to the tWriteJSONField component. For exmaple:

```
output_row.rootNode = input_row.rootNode.replaceAll("\\[\\]", "");
```