# JSON Deserialization

This action is used to convert a string to a JSON Object.

## **Properties**

![](/files/-MfdZ360uVJ49VBfT9jR)

### **Input**

* **Content**: the name of the variable which stores the string content.
* **Output**: the name of the variable used to store the result.&#x20;

{% hint style="info" %}
the output must be a **JObject** type.
{% endhint %}

### **Misc**

* **Display Name**: action display name in your implementation project.
* **Wait Before**: number milliseconds robot to wait before executing the action.
* **Wait After:** number milliseconds robot to wait until moving to the next action.
* **Abort on Error:** True/False
* **Retry Times**: Specifies the number of times to retry an action if it doesn't end successfully. Default value 0 (no retry); Use -1 if you want to retry indefinitely.&#x20;

## **Use Case**

### **Potential Use Cases**

* Deserialize information captured via HTTP Rest Request, in order to use it in the workflow.

### **Examples of Using JSON Deserialization**

**Example 1**

In this example, the robot will access the API of coindesk.com and retrieve the price of bitcoin in EUR.

**Steps**:

* Create a new project
* Create a new [Sequence ](/actions/tap-actions/diagram/sequence.md)and rename it.
* Create 2 variables: a string and a JSONobject

![](/files/-Mfdae34bWVTDoW7r01C)

* Add a new activity HTTP Rest Request in the newly created Sequence and edit the following parameters:
  * **URL**: "<https://api.coindesk.com/v1/bpi/currentprice.json>"
  * **Method**: GET
  * **Output**: a string variable (outputREST)
  * **Response Code**: an int32 variable (responseCode)

![](/files/-MfdaqWYOs6HTGVHoXtU)

* Add a new activity **JSON Deserialization** in the same Sequence and edit the following parameters:
  * **Content**:  the same string variable (outputREST)
  * **Output**: a JObject variable (rate)

![](/files/-Mfdb4yUZnRGlctfIouP)

* Add a [Write to Console ](/actions/tap-actions/loging/write-to-console.md)activity having as output:

```
"Today, "+DateTime.Now + ", 1 bitcoin = " + rate["bpi"]["EUR"]["rate"] + " EUR"
```

&#x20;where **rate\["bpi"]\["EUR"]\["rate"]** is the JSON hierarchy (please see the screenshot below from JSON formatter)

![](/files/-MT2MDG9feuaxLBe7cxL)

This is how your sequence should look like.

Watch the robot in action:

{% embed url="<https://youtu.be/rq1qaGl-0Sg>" %}

You can see how the **JSON Deserialization** activity is used in an example that incorporates multiple activities. You can check and download the example from here:

{% file src="/files/-MT2LeY\_YA-Y7kBVmbHa" %}
HTTP REST & JSON Deserialization sample project
{% endfile %}

The article doesn't fully answer your question, or you want to find out more? Ask your question in the comments, on our community forum, or contact our support team or your account manager. Whatever works for you, your question will find its answer soon!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tailent.com/actions/tap-actions/data/json-deserialization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
