I have a JsonString converted from Table Data like this
[{“column”:“Value”}, {“column1”: “value1”, {“column2”:“value2”}]
and I want to convert this JsonString to String as :
“[{\“column\”:\“value\”}, {\“column1\”:\“value1\”}, {\“column1\”:\“value1\”}]”
can some please help me on this?
I am getting this error : Newtonsoft.Json.JsonSerializationException: Deserialized JSON type ‘Newtonsoft.Json.Linq.JArray’ is not compatible with expected type ‘Newtonsoft.Json.Linq.JObject’. Path ‘’, line 1, position 2273. at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateJToken(JsonReader reader, JsonContract contract)
I extracted the tableData and directly converted to JsonString by using this formula “Newtonsoft.Json.JsonConvert.SerializeObject(tableData)”, but this format is not able to send it to postman as JsonString, it requires as the second format.
No, the format is correct basically from the tableData I am converting into JsonString, So it is basically a JsonArray but in String format.
Yes While Deserializing I am getting the error, but for Deserialize JsonArray and store it as JObject I wont get any errorbut Once Deserialized and print output using log message as JObject.ToString, I am still getting the Same output but as JsonArray Format. but I want second format.
When you take the first format and paste it on Json Stringify website, it will give second format
Use the Deserialize JSON Array activity to parse the JSON array into a .NET object.
Use the Serialize method to convert into a JSON string.
Newtonsoft.Json.JsonConvert.SerializeObject(jsonArrayObject)