Unable to Display data from Dictionary type of String and List <Data Table>

Hi , I have a dictionary populated when the robot runs, I need to display the data from the dictionary which is type of string and List Please see the screen shot, How do I display data ? Thanks

Groupings Dictionary<System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.List<System.Data.DataTable>>

Display in sense of Inspections we would recommend to use the debug panels and/or some Analysis Statements e.g. in LINQ

Display in sense of getting it as a string we would recommend to check if it is needed (due we do inspections as above). Which output you would like to get: All rows, with headers, list position info…?

So you have…

Dictionary(of String, List(of Datatable))

That means yourDict(“somekey”) will return a list(of datatable). So then yourDict(“somekey”)(0) will return the first datatable in the “somekey” list. yourDict(“somekey”)(0).Rows(0) will return the first row in the first datatable in the “somekey” list. yourDict(“somekey”)(0).Rows(0).Item(0).ToString will return the value in the first column of the first row of the first datatable in the “somekey” list. They’re all 0 index so 0 is the first list item, first row, first column.

You could also do it by column name so if you have a column named “Company” you could do yourDict(“somekey”)(0).Rows(0).Item(“Company”).ToString to get the company value from the first row in the first datatable in the “somekey” list.

I’m curious though, why is this what you’re doing?

Hi Paul,
In the Debug Panel, This what the value for Dictionary named “Grouping” has
when I run in Debug mode with a break point

Dictionary<string, List>(1) { { “Risk Details”, List(1) { [Fields] } } }

So the Dictionary has a Value name “Risk Details” and I would like to know the content of the Risk Details category which has a List
I would like to extract the content from this List/DataTable and save it in a variable or is there any way I can refer directly to its value ?
appreciate your help

You refer to it directly as Grouping(“Risk Details”)

That’ll give you the list. You can use it anywhere you’d use any list. For example, you could use it in a For Each to loop through the list values. From what you posted we can tell your dictionary has one key/value pair, and that one value is a list with one element “Fields”