# Deserialize Activity - problem

**URL:** <https://forum.uipath.com/t/deserialize-activity-problem/490051>\
**Category:** Activities\
**Tags:** question, webapi, activities\
**Created:** [November 14, 2022, 4:47pm UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051 "2022-11-14T16:47:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkurnik](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jkurnik/32/263775_2.png) [@jkurnik](https://forum.uipath.com/u/jkurnik)\
**Post date:** [November 14, 2022, 4:47pm UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/1 "2022-11-14T16:47:16Z")

</div>

Hi everyone, I’m trying to deserialize json like:

[{“System”:{“CSR”:“PEA”}},{“System SAC”:{“SAC”:“CC BB WW”}}]

which is valid json format. When I try to use Deserialize JSON activity comming from UiPath.WebAPI.Activities ver 1.13.2 I have an error:

Deserialize JSON: Deserialized JSON type ‘Newtonsoft.Json.Linq.JArray’ is not compatible with expected type ‘Newtonsoft.Json.Linq.JObject’. Path ‘’, line 1, position 61.

What is wrong ?

---

<div class="post-metadata">

**Author:** ![Konrad\_Mierzwa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/konrad_mierzwa/32/464054_2.png) [@Konrad\_Mierzwa](https://forum.uipath.com/u/Konrad_Mierzwa)\
**Post date:** [November 14, 2022, 5:03pm UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/2 "2022-11-14T17:03:41Z")

</div>

Hi  
I had the same error in the same activity.  
In my case problem was in Newtonsoft.Json package.  
This error appear for Newtonsoft.Json \> 13. If you are able to downgrade this dependency to 11.x it should solve this issue.

---

<div class="post-metadata">

**Author:** ![Jon\_Smith](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jon_smith/32/523286_2.png) [@Jon\_Smith](https://forum.uipath.com/u/Jon_Smith)\
**Post date:** [November 14, 2022, 5:19pm UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/3 "2022-11-14T17:19:07Z")

</div>

So there is nothing wrong with NewtonSoft version 13. Its a bug with the UiPath activity which, frankly, really isn’t needed as this is a single line operation.

Just have an assign activity and place the folllowing code in it.

C#  
Newtonsoft.Json.JsonConvert.DeserializeObject(@“[{”“System”“:{”“CSR”“:”“PEA”“}},{”“System SAC”“:{”“SAC”“:”“CC BB WW”“}}]”)

[VB.net](http://VB.net)  
Newtonsoft.Json.JsonConvert.DeserializeObject(of JArray)(“[{”“System”“:{”“CSR”“:”“PEA”“}},{”“System SAC”“:{”“SAC”“:”“CC BB WW”“}}]”)

This is something I posted on the official UiPath response too, for reference.

> [@Cannot Deserialize JSON](https://forum.uipath.com/t/cannot-deserialize-json/403496):
>
> How to get rid of below error when trying to Deserialize JSON - "Deserialize JSON: Cannot create and populate list type Newtonsoft.Json.Linq.JToken. Path 'List', line 1, position 102." ? This issue happens because of a dependency conflict when using UiPath.System.Activities and UiPath.GSuite.Activities. Make sure to check both packages exist (UiPath.System.Activities and UiPath.GSuite.Activities) Check the dependencies of each package for Newtonsoft.Json If the version of Newtonsoft.Json pac…

---

<div class="post-metadata">

**Author:** ![sangeethaneelavannan1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sangeethaneelavannan1/32/176935_2.png) [@sangeethaneelavannan1](https://forum.uipath.com/u/sangeethaneelavannan1)\
**Post date:** [November 15, 2022, 12:26am UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/4 "2022-11-15T00:26:14Z")

</div>

@jkurnik Welcome to UiPath Community

[![](https://global.discourse-cdn.com/uipath/original/4X/9/0/d/90dfb647d8b106aad1220d082dffff1e7484eae4.jpeg "UiPath Json Array | Deserialize Json Array UiPath | UiPath Json deserialize | UiPath Tutorial") ](https://www.youtube.com/watch?v=MUbzG6xHubU)

---

<div class="post-metadata">

**Author:** ![jkurnik](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jkurnik/32/263775_2.png) [@jkurnik](https://forum.uipath.com/u/jkurnik)\
**Post date:** [November 15, 2022, 10:50am UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/5 "2022-11-15T10:50:08Z")

</div>

> [@Jon\_Smith](#):
>
> Newtonsoft.Json.JsonConvert.DeserializeObject(of JArray)(“[{”“System”“:{”“CSR”“:”“PEA”“}},{”“System SAC”“:{”“SAC”“:”“CC BB WW”“}}]”)

How to use it? Where to past this function?

---

<div class="post-metadata">

**Author:** ![Jon\_Smith](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jon_smith/32/523286_2.png) [@Jon\_Smith](https://forum.uipath.com/u/Jon_Smith)\
**Post date:** [November 16, 2022, 6:01pm UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/6 "2022-11-16T18:01:32Z")

</div>

> [@jkurnik](#):
>
> > [@Jon\_Smith](#):
> >
> > Newtonsoft.Json.JsonConvert.DeserializeObject(of JArray)(“[{”“System”“:{”“CSR”“:”“PEA”“}},{”“System SAC”“:{”“SAC”“:”“CC BB WW”“}}]”)
> 
> How to use it? Where to past this function?

> [@Jon\_Smith](#):
>
> Just have an assign activity and place the folllowing code in it.

See my instructions as above.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [November 22, 2022, 4:05pm UTC](https://forum.uipath.com/t/deserialize-activity-problem/490051/7 "2022-11-22T16:05:16Z")

</div>

Closed on November 22, 2022, 4:05pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
