--- title: "JSON to object" slug: "core-json-decode-resolver" updated: 2026-04-15T13:12:52Z published: 2026-04-15T13:12:52Z canonical: "docs.lobstersoftware.com/core-json-decode-resolver" --- > ## 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. # JSON to object *See also:* [Object to JSON](/v1/docs/en/core-json-encode-resolver) > [!NOTE] > Value resolver – Abstract > > **Purpose:** Parses a string provided as *input value* as a JSON structure to return an object. > > > [!TIP] > > Tooltip > > > > - **Usage**: The value resolver returns the generated object if successful. > > - **Parameter**: The **Class field name** (default value `class`) determines which name in the JSON structure defines the class of objects. > > - **NOTE:** If no value (`$null`) is present as *input value*, then no value (`$null`) is returned. ![images/download/attachments/106955200/EN_title_0-version-1-modificationdate-1655312828447-api-v2.PNG](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/7a9d7f2a-efd3-4d74-9772-437e6790022b) The [Server xml to object](/v1/docs/en/core-server-xml-decode-resolver) value resolver parses a string passed as input value as JSON to return an object. The following cases are differentiated: | Input value (abstract) | Input value (specific examples) | Return value | Error | | --- | --- | --- | --- | | No value (`$null`) | No value (`$null`) | No value (`$null`) | n/a | | A string that violates the rules of the JSON notation | *Empty string ("")* --- `{fieldName:=fieldValue}` | n/a | `ProcessException:Failed to parse` | | `A string that conforms to the rules of the JSON notation` | `null` | No value (`$null`) | n/a | | `"null"` | Null (*String*) | n/a | | `1.5e3` | 1500.0 (*Double*) | n/a | | `[ABC,123,true,null]` | An array or list with four elements: ABC (*string*), 123 (*long*), true (*Boolean*), no value (`$null`) | n/a | | `{"msg":"Hello World!"}` | A client object with an `msg` property containing the "Hello World!" *string* | n/a | | `{"class":"de.lobster.scm.scem.incident.Incident", "id":666,"name":"doom","incidentSeverity":"HIGH"}` **NOTE:** The "volatile entity" created from this JSON structure (see "Return value" column, right) can be saved using the [Save changes later](/v1/docs/en/core-merge-later-once-actor) event action, for example, to create the entity server-side. However, this only works if the ID 666 is not yet in use. **WARNING:** The assignment of IDs for new entities should definitely be left to the **Lobster Data Platform/Orchestration** server by assigning the ID `0`. Then the entity is automatically assigned a new ID when it is saved. Interventions in the assignment of IDs – especially by assigning IDs in the area of the number range that has not yet been used – can result in conflicts in later write operations. | If the appropriate **Class field name** `class` is used: A "volatile" entity of the "Incident" type (see [SCEM Incident](/v1/docs/en/scem-incident)) with ID `666` and severity `HIGH`, but without the "name" property, which is not provided for in the data model of the class (`Incident`): ```json { "class": "de.lobster.scm.scem.incident.Incident", "affectedEntities": null, "created": null, "creatorId": "0", "id": "666", "incidentSeverity": "HIGH", "incidentSource": null, "incidentState": null, "incidentType": null, "lastModified": null, "lastModifierId": "0", "ownerId": "0", "partialLoaded": false, "temporaryValues": null } ``` (Entity data in JSON notation) / In the JSON notation, the values of properties that are `Long` values by definition in the `Incident` class data model appear as strings (between apostrophes). This example concerns the `id`, `creatorId`, `lastModifierId` and `ownerId` properties. --- If the **Class field name** is inappropriate (e.g. `ignoreClass`), a client object is returned containing all data of the *input value*, i.e. also a `class` property with the class name for [SCEM Incident](/v1/docs/en/scem-incident): ```json { "name": "doom", "incidentSeverity": "HIGH", "id": { "clazz": "java.lang.Integer", "value": 666 }, "class": "de.lobster.scm.scem.incident.Incident" } ``` (Data of the client object in JSON notation) **NOTE:** This JSON structure was created with the [Object to JSON](/v1/docs/en/core-json-encode-resolver) value resolver. For demonstration purposes, the value `clazz` was used for the parameter **Class field name**, deviating from the default (`class`). This allows a distinction to be made between the `class` property that actually existed in the generated client object and the name `clazz` that was added when decoding the `Long` value (`666`) for the JSON output of the `id` property. | n/a | ## Configuration | Parameter | Meaning | | --- | --- | | **Class field name** | The parameter defines a property name that can be used within the JSON string to identify the class of an object. The `class` property is used by default (see example above). | | **Parse array as a list** | This option is selected by default, so that an array (in the *input value*) is converted into a "list" object (*List*). | ## Example In the context of an event handling, the user should be able to enter a comma-separated list of values via [User prompt](/v1/docs/en/frebehav-user-prompt), the total of which is subsequently calculated. Runtime example: ![images/download/attachments/106955200/image2022-6-20_12-15-20-version-1-modificationdate-1655720120706-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-6-20_12-15-20-version-1-modificationdate-1655720120706-api-v2.png) - A discount of 10% (-250) is deducted from a list price of 2500 (25 x 10²) and a handling fee of 12.5 is added. Result: ![images/download/attachments/106955200/image2022-6-20_12-15-45-version-1-modificationdate-1655720145927-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-6-20_12-15-45-version-1-modificationdate-1655720145927-api-v2.png) Configuration: | The [JSON to object](/v1/docs/en/core-json-decode-resolver) value resolver is used here to demonstrate "resolving" the text value from the [User prompt](/v1/docs/en/frebehav-user-prompt) into a list of individual values. The surrounding [Concat strings](/v1/docs/en/core-concat-string-resolver) value resolver encloses the user's input in square brackets (`[ ... ]`) for this purpose. Provided that the input is a comma-separated list of strings that can be interpreted as numeric values (see example), the expression as a whole results in a text that defines a list of numeric values in JSON format. The [User prompt](/v1/docs/en/frebehav-user-prompt) is used in conjunction with the [Concat strings](/v1/docs/en/core-concat-string-resolver) and the chained [JSON to object](/v1/docs/en/core-json-decode-resolver) value resolver directly to define the **Resolver for entities** parameter in a [For each loop](/v1/docs/en/core-for-each-entity-actor) event action. The loop iterates over the entered scalar values and adds them successively via [Calculate value](/v1/docs/en/core-calculate-value-resolver) value resolver in the variable `total`. The scalar value is included in the calculation via the variable `increment`. After the loop has been completed, the amount can be read from the `total` variable. It is output here via [Show alert (Popup)](/v1/docs/en/core-popup-actor). **IMPORTANT:** In addition to the configuration shown here, the variable `total` should be explicitly assigned the value 0 before the start of the loop. Otherwise, a possible value already present can falsify the result. | ![images/download/attachments/106955200/image2022-6-20_12-17-29-version-1-modificationdate-1655720249635-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-6-20_12-17-29-version-1-modificationdate-1655720249635-api-v2.png) | | --- | --- |