JSONConvert not declared

Hello everyone,

I am trying to serialize a data table into JSON format. For that I am using the following statement in assign (JsonConvert.SerializeObject(“string”)).

The project has several flows. While the JSON Convert is working in 2 flows, I get the error message that JSONconvert is not declared in any new flow in the same project. What am I missing?

I found that but the namespace is included in my dependencies:
JsonConvert was not declared.It may be inaccessible due to its protection level - Help - UiPath Community Forum
image

Thanks!

Hi @PeCour,

As I understand you do not need to declare the Newtonsoft.Json as a project wide dependency. We have had similiar clashes with Interop imports as dependency on whole project vs. Interop being imported in dedicated workflows. I would suggest import the required namespaces in each workflow that way they are self sufficient.

Within the workflow giving you issues, you can check if the imports of Newtonsoft.Jsonis made correcty.

Headsup:
Also, before you delete the project wide dependency. Do evaluate what the consequence will be. You would not want to delete something which is workin in 50 workflows but failing in 2 without knowing the root cause.

2 Likes

Hi

Did this thread help you resolve this

Cheers @PeCour

1 Like

@jeevith and @Palaniyappan Thank you for your fast help! It worked and I now understand how to import namespaces. #happylearning

2 Likes

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