Printing Dictionary Values

Hi @Luis_Fernando,

There can be many ways to do this. Here is what I usually use.

  • TestDictionary.Keys returns array
  • Iterate through the array using For Each activity
  • Use the Key as the key name and TestDictionary(Key.ToString) as value
  • Optionally, I use the index value in the for each, for debugging purposes

So the expression would look like this.
"Index value "+Index.ToString+" Key : "+key.ToString+" with value : "+TestDictionary(key.ToString)

This method should work for most native variable types like string, int, datetime, boolean etc. But if your Dictionary holds any custom variable type (for example, UiElement) then you will need to change this approach slightly.

Here is the sample file for you to try:
PrintDictionary.xaml (7.4 KB)

Hope this helps you and others.

3 Likes