Am working on a process , I dont have any errors coming up in the XAML but the Value for Keys which have multiple values is shown as a single string.
Example :
expected for enr2 : [“Mem1”,
“La1”,
“xyz”,
“abc”,
“qwer”]
actual result for enr2:
“Mem1,La1,xyz,abc,qwer,jklm”
HI @Nithinkrishna,
I am taking all the rows in the data table.
The problem is with the Keys which have multiple values are taken as single string which should not be the case for my workflow which i attached earlier.
thanks @ppr,
Can you elaborate on where exactly do we make the changes in my xaml … I am new to Uipath dont have much information on how to implement the changes
In my actual process I have many keys which have multiple values and doing assign myJObject(“enr2”)=JArray.FromObject({“Mem1”,“La1”,“xyz”,“abc”,“qwer”,“jklm”}) for each key might be difficult. Also these values are not constant , its not same always. Could you please suggest for my XAML how do i go about implementing it.
@ppr Any suggestions on the requirement or if you can help me with the updated XAML which give us the desired results.
As i said many keys would have multiple array of values so changing each key might not work for my process.
kindly note: we shared a snippet to demonstrate on how the general implementation block would look like. As we can see from the screenshot the JSON was updated as requested ["A","B"]
For sure you will adapt it and dynamize it.
we do feel that your case description needs some more elaboration and we would recommend to follow the pattern: All inputs, case description, expected output description. This would help us for guiding you on a solution approach
I did try the myJobject(“enr2”) = JArray.FromObject({“Mem1”,“La1”,“xyz”,“abc”,“qwer”,“jklm”})
But my Json object might have other keys Eq: e1: j1,j2,j3 . So we might be able to use assign activity for everytime manually putting in he values.
As for the XAML i shared my process includes updating a JSON with the values from an excel. I had created a sample XAML which involves the following steps:
1.Datatable has key and value column which has the Key Value Pairs
2. Another Datatable for mapping the key values
3. Read Text file activity to read the JSON data.
4. Deserialize the JSON file
5. Assigned dictKLValues =dtData.AsEnumerable.ToDictionary(Of String, Object)(Function (x) x(“Key”).toString, Function (x) x(“Value”))
6. Looop through the Mapping Datatable to update the values using Invoke method.
The expected output for all the Keys which have multiple values is as shown below:
“enr2”: [
"Mem1",
"La1",
"xyz",
"abc",
"qwer"
]
whereas we get it as “enr2”:“Mem1,La1,xyz,abc,qwer,jklm”
This is not the expected result. I wanted help modifying my XAML accordingly which would give me the expected result. Once this is sorted the complete update JSON would be pasted in a internal WebPage.
I hope this gives a gist of my requirement.
Please do let me know if any further information is required.