Hi, everyone.
I am learning how to handle Json in UiPathStudio.
I would like to output a Json like (B) below.
As shown in (A), after setting the “dependencies” element to Dictionary<String, Object>, it can be set to the top-level Dictionary<String, Dictionary<String, Object>.
By setting it to a top-level Dictionary<String, Dictionary<String, Object>>.
I could output JSON without errors.
(A)
{
“dependencies”: {
“UiPath.Excel.Activities”: “[2.11.3]”,
“UiPath.System.Activities”: “[21.10.0]”
}
}
However, if I try to mix a String and a Dictionary type in the value part of the top-level Dictionary, as shown in (B) below, I got an error saying that the type cannot be converted.
(“Main.xaml” is a string type, but the “Uipath.Excel…” is a Dictionary Type, which is a different type)
“A compile error occurred while processing the argument ‘Value’:expression ““arbitrary string””.
Cannot convert value of type ‘String’ to ‘System.Collections.Generic.Dictionary(Of Sring, Object)’.”
What type specification would be required to output (B)? Or, what kind of UiPath activity settings do I need to use to output (B)?
(B)
{
“main”: “Main.xaml”,
“dependencies”: {
“UiPath.Excel.Activities”: “[2.11.3]”,
“UiPath.System.Activities”: “[21.10.0]”
},
“webServices”:
}
I use “Microsoft.Activities.Exctentions=2.0.6.9” to add to the dictionary, but you can use other methods as well.
I expect to use it heavily in the BODY element when making http requests to other systems in the future. So I want to understand the input and output of JSON accurately.
Thanks.