Second Level of JSON String after upgrade the package Newtonsoft.json

Hi community,
I upgraded the Newtonsoft.json 11.0.2 to 12.0.3 and my solution was broken.

I’m reading a .json using Read text File and converting string to json using Deserialize Json.
Currently I have been having issues when I try to access the 2 levels of the dictionary.

  • Good!!!
    “Price”: “3.99”,
    “Expiry”: “1234”,
    “Name”: “Apple”

  • Fail!!
    “Price”: “3.99”,
    “Expiry”: “1234”,
    “Name”: “Apple”,
    “Price”: “3.99”,
    “Expiry”: “1234”,
    “Name”: “Apple”

This issue appeared when I upgraded the package. I don’t want to rollback the activity. Does anyone have a workaround or any solution that could help me?

Hello @Rafael_Zamora!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly

Hi @Rafael_Zamora

Could you see if parsing with a simple assign activity, like so, will work:

yourJObjectVariable = JObject.Parse(yourString)
1 Like

Hi @loginerror It works! Thank you so much! :raised_hands:

@Rafael_Zamora both Studio and the Robot use Newtonsoft.json 11 and explicitly adding v12 as a dependency to your project causes such problems.

May I ask why you need it as a direct dependency? The Web package (which you have installed, since you’re using Deserialize JSON) already lists it as a sub-dependency, so you already have access to the library.

Hi @Tudor_Sandu
I’m adding the most upgrade package inside my project. Only for good practices.
But When I upgrade Newtonsoft.json 11 to 12, the Deserialize JSON was failed when I used a Second level of Json.
Using JObject.Parse (yourString) helped me with my problem using an assign instead of the activity.

Yes, and I’m telling you that Newtonsoft.json 12 is not compatible with Studio, Robot and System 20.10 and Web 1.6.0.

I’m also asking why you need to load it as a dependency. The library is already included in your project (at version 11) as a sub-dependency of UiPath.Web.Activities.

1 Like

@Tudor_Sandu For no particular reason. Excellent! I removed this activity / dependency and I am currently using the C # library. I didn’t know it worked without that.

1 Like

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