--- title: "JsonCreationUnit" slug: "json-creation-unit" updated: 2025-09-17T19:33:25Z published: 2025-09-22T09:16:30Z canonical: "docs.lobstersoftware.com/json-creation-unit" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # JsonCreationUnit | **Class name** | com.ebd.hub.datawizard.iu.JsonCreationUnit | | --- | --- | **This Integration Unit is deprecated.** Please use the "ExtendedJsonCreationUnit" for newly developed profiles. This Integration Unit generates a JSON document out of the target tree. The encoding of the file is always UTF-8. Each record creates an object *{content}*. Multiple records are written into a list *[{content1},{content2}]*. If the target structure node attribute "XML/JSON handling" is set to *Exclude*, the JsonCreationUnit will not process the node. Numbers after a # in field and node names are ignored during the JSON generation. See the creation of arrays below. ## Parameters | Parameter | Allowed values | Default value | Description | | --- | --- | --- | --- | | Decode unicode values | true, false | false | If *false*, certain characters (e.g. ", <, >) are replaced by Unicode escape sequences. If *true*, this is not done, except for the " character, which is replaced by *\u0022*. | | Escape < and > | true, false | false | The characters *<* and *>* are escaped by this Integration Unit. The result is *<* und *>* This option should be set to *true* if the Integration Unit is used for [Forms](/docs/en/datacockpit-forms). This can prevent JavaScript injection. | | Force array creation for nodes with max > 1 | true, false | true | If *true*, nodes with *Maximum* > *1* will always create an array, even if the nodes were only entered once. | | Pretty print | true, false | false | If *true*, the JSON file is formatted. | | Resolve OData names | true, false | false | A name like *@company.com* would be allowed in JSON but is escaped in this Integration Unit. The result would be *__at__company__dot__com* If you do not want those characters to be escaped, set the option to *true.* | | Start at node | | | If a node name is set, the creation of the JSON file starts with this node. Without node name, the complete tree is created. | | Use description as field/node name | true, false | false | If set to *true* and the field/node attribute *Description* has a value, the value of the attribute is used instead of the field/node name in the JSON file. | | Use transparent nodes | true, false | false | If *true*, the target node attribute "XML/JSON handling=Transparent" will be considered. See the notes below in the example. | | Write empty fields not as null | true, false | false | If *true* and parameter *Write empty/null field values* is also *true*, value *""* will be used instead of value *null*. | | Write empty/null field values | true, false | false | If *true*, fields with set Empty Flag will be included in the JSON document with value *null*. See also parameter *Write empty fields not as null*. | | Write top level nodes as objects | true, false | true | If *true*, all nodes on root level will create separate objects, e.g. *{"node_name":{"content"}}*. If *false*, the content of those nodes will be written directly. | | Write values type safe | true, false | false | If *true*, fields of type *Integer*, *Float*, *Double*, *BigInteger*, *BigDecimal* and *Boolean* will **not** be written in quotes. **Important note:** This setting has no effect if a template is used. | ## Example The following target tree is used to create a JSON document. ![images/download/attachments/201685403/287-version-1-modificationdate-1749697935388-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/287-version-1-modificationdate-1749697935388-api-v2.png) If the parameter *Write top level nodes as objects* is set to *true*, the following file will be created. ```demo1 {"Invoice":    {    "invoice_no":"4711",    "iln_buyer":"400000045687",    "iln_supplier":"123456789",    "delivery_no":"0815",    "item":[        {"article_no_supplier":"87490","EAN":"3654878784","content":"Sausage","unit":"pcs","quantity":"200","item_no":"1","price":"30","vat_rate_item":"19"},        {"article_no_supplier":"8786767","EAN":"546546","unit":"pcs","quantity":"1","item_no":"2","price":"56"}    ],    "invoice_no":"08154711",    "vat_rate_1":"19",    "vat_rate_2":"7",    "currency":"EUR"    } } ``` If the parameter *Write top level nodes as objects* is set to *false*, the file will look like this. ```demo2 {    "order_no":"4711",    "iln_buyer":"400000045687",    "iln_supplier":"123456789",    "delivery_no":"0815",    "item":[        {"article_no_supplier":"87490","EAN":"3654878784","content":"Sausage","unit":"pcs","quantity":"200","item_no":"1","price":"30","vat_rate_item":"19"},        {"article_no_supplier":"8786767","EAN":"546546","unit":"pcs","quantity":"1","item_no":"2","price":"56"}    ],    "invoice_no":"08154711",    "vat_rate_1":"19",    "vat_rate_2":"7",    "currency":"EUR" } ``` ### Transparent nodes Nodes marked blue have the target structure node attribute "XML/JSON handling=Transparent". Following the results depending on the Integration Unit parameter "Use transparent nodes". | Target tree | Result (Use transparent nodes = true) | Result (Use transparent nodes = false) | | --- | --- | --- | | ![images/download/attachments/201685403/286-version-1-modificationdate-1749697935387-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/286-version-1-modificationdate-1749697935387-api-v2.png) | ![images/download/thumbnails/201685403/image2017-5-2_20_35_22-version-1-modificationdate-1749697935376-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-2_20_35_22-version-1-modificationdate-1749697935376-api-v2.png) | ![images/download/thumbnails/201685403/image2017-5-2_20_41_36-version-1-modificationdate-1749697935366-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-2_20_41_36-version-1-modificationdate-1749697935366-api-v2.png) | The same transparent node must not be created multiple times. If that happens, the Integration Unit aborts with an error. **Note:** For transparent nodes with the attribute *maximum* > *1*, a warning is output in the log. | Target tree | Result (Use transparent nodes = true) | Result (Use transparent nodes = false) | | --- | --- | --- | | ![images/download/attachments/201685403/288-version-1-modificationdate-1749697935389-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/288-version-1-modificationdate-1749697935389-api-v2.png) --> ![images/download/attachments/201685403/289-version-1-modificationdate-1749697935390-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/289-version-1-modificationdate-1749697935390-api-v2.png) | **Error:** *transparent node 'TransparentNode_Error' may not have more than one iteration* | ![images/download/attachments/201685403/image2017-5-2_20_45_0-version-1-modificationdate-1749697935369-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-2_20_45_0-version-1-modificationdate-1749697935369-api-v2.png) | However, it is possible to use multiple transparent nodes. As you can see in the example, the values of fields with the same name are then summarised (as you already know: *value#1* and *value#2* become *value* in the JSON document). **Note:** This is effectively an array (see below). | Target tree | Result (Use transparent nodes = true) | Result (Use transparent nodes = false) | | --- | --- | --- | | ![images/download/attachments/201685403/290-version-1-modificationdate-1749697935391-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/290-version-1-modificationdate-1749697935391-api-v2.png) | ![images/download/thumbnails/201685403/image2017-5-2_20_54_28-version-1-modificationdate-1749697935360-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-2_20_54_28-version-1-modificationdate-1749697935360-api-v2.png) | ![images/download/thumbnails/201685403/image2017-5-2_20_55_3-version-1-modificationdate-1749697935358-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-2_20_55_3-version-1-modificationdate-1749697935358-api-v2.png) | ### Arrays An array can be created by using single fields with the same name. Everything after the # in the field name will be ignored. So *ArrayValue#1-3* becomes *ArrayValue.* | Target structure | Result | | --- | --- | | ![images/download/attachments/201685403/147-version-1-modificationdate-1749697935379-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/147-version-1-modificationdate-1749697935379-api-v2.png) | ![images/download/thumbnails/201685403/image2017-5-3_13_0_33-version-1-modificationdate-1749697935347-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-3_13_0_33-version-1-modificationdate-1749697935347-api-v2.png) | Alternatively, simple arrays/lists can be generated with a node/field combination. The node may only contain one field. The field name has to be like the node name plus the suffix *_val.* The node is traversed several times. **Important note:** This does not work with several nodes of this kind. So if there were a node *MyArray* and further down in the structure another node *MyArray#2*, then the mechanism described would only work for the first node *MyArray*. | Target structure | Result | | --- | --- | | ![images/download/attachments/201685403/145-version-1-modificationdate-1749697935377-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/145-version-1-modificationdate-1749697935377-api-v2.png) | ![images/download/thumbnails/201685403/image2017-5-3_12_53_42-version-1-modificationdate-1749697935365-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2017-5-3_12_53_42-version-1-modificationdate-1749697935365-api-v2.png) |