# How to Convert String To Dataset

**URL:** <https://forum.inductiveautomation.com/t/how-to-convert-string-to-dataset/24782>\
**Category:** Ignition\
**Created:** [May 8, 2019, 7:47am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-dataset/24782 "2019-05-08T07:47:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guptavijayakshay](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@guptavijayakshay](https://forum.inductiveautomation.com/u/guptavijayakshay)\
**Post date:** [May 8, 2019, 7:47am UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-dataset/24782/1 "2019-05-08T07:47:09Z")

</div>

I am getting a value in Json Format and Assigned it into a String.  
In Java, How can i Convert a String Value into a Data Set of Ignition. And  
how do i Convert a Json Object to Data Set?

```
postRequest.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString());
ObjectMapper mapper = new ObjectMapper();
HttpEntity entity;
entity = new StringEntity(mapper.writeValueAsString(context), ContentType.APPLICATION_JSON);
postRequest.setEntity(entity); 
CloseableHttpResponse httpResponse = null; 
httpResponse = httpClient.execute(postRequest); 
String response = null;
response = EntityUtils.toString(httpResponse.getEntity());
AnalysisData = response;
Dataset dataset = Dataset.class.cast(vAnalysisData);
```

---

<div class="post-metadata">

**Author:** ![Lalillo1](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@Lalillo1](https://forum.inductiveautomation.com/u/Lalillo1)\
**Post date:** [July 29, 2022, 10:02pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-string-to-dataset/24782/2 "2022-07-29T22:02:43Z")

</div>

Did you get an answer for this?
