vikumars
(vinoth kumar)
June 5, 2023, 8:13am
1
Hi Team,
Values are received to the UiPath in_Arguments from UiPathh Apps like this [“RPA”,“UiPath”] .
Which variable type could hold the above values? I Have tried with String, String Array , JArray.
I am facing below error:
Error ERROR Validation Error Compiler error(s) encountered processing expression “[“RPA-ITS-DeliveryTeam”,“PNPOrganizationteam”]”.(2) : error BC30201: Expression expected.
(2) : error BC30198: ‘)’ expected.
(2) : error BC30203: Identifier expected.
(2) : error BC30037: Character is not valid.
@Palaniyappan @Jobin_Joy
ppr
(Peter Preuss)
June 5, 2023, 8:37am
2
["RPA","UiPath"]
is the JSON representation of aString Array
we can parse this Serialized string within a JArray
Use Deserialize JSON Array Activity or Code:
Newtonsoft.Json.Linq.JArray.Parse(strJSON)
we can bring it it into a StringArray/StringList by:
One of many options
ppr
(Peter Preuss)
June 5, 2023, 8:49am
4
you have to escape the inner doublequotes
var1 = "[""RPA"",""UiPath""]"
is a string
OR
var1 | JArray = Newtonsoft.Json.Linq.JArray.Parse("[""RPA"",""UiPath""]")
vikumars
(vinoth kumar)
June 5, 2023, 8:53am
5
Actually, this value comes from UiPath Apps to the in_Argument in UiPath.
Since it comes with square brackets, I cannot store it in the Argument due to challenges in variable type.
ppr
(Peter Preuss)
June 5, 2023, 8:56am
6
Just read carefully the code snippets
we had shown you on how to handle:
The String / JSON String
on how manually construct a JSON String handling the inner double quotes
you can prototype it by using the immediate panel
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
ppr
(Peter Preuss)
June 5, 2023, 8:57am
7
You can, as it is a JSON String | DataType: String