How to use invoke code?

I need to convert a json string to FHIR Json ,for that I’m trying to invoke vb code in my workflow using invoke code activity

But it’s showing an error in Imports I don’t know how to solve it and I also don’t know how to invoke the arguments I couldn’t see the arguments I created in this activity in the arguments panel

Hi,

InvokeCode activity is like method.

We can set argument of the method from EditArgument
We can write code inside the method from EditCode

And we cannot write some statement such as import because it’s like inside method.

Regards

2 Likes

Please check the documentation Activities - Invoke Code - https://docs.uipath.com/.

As for the error you’re facing, you shouldn’t import namespaces within the Invoke Code activity. Add the namespace instead in the “Imports” panel in Studio designer view, or install the package as a dependency (only if it’s not already present - Newtonsoft.Json should be there).

@Sangeetha_R1

Imports in UiPath are done in the imports menu at the bottom of the studio

And it can be directly used in invoke code and need not use import statements in invoke code

Cheers