I am reading data from excel using Read Range activities and doing data entry for each row item retrived from data row. As I have current 10-12 columns and I have to pass these values to multiple workflows I would like to know if there is a way to convert the data row into a dictionary of (Columnname,Value ) so that I could just pass the dictionary between workflows instead of 10-12 variables.
It might be too late, but it might serve for someone else in the future. I was having kind of the same issue, I needed to convert an “n” amount of columns into a “n” amount of key pairs to add into a dictionary, my solution is this:
Inside of a “For Each row in DataTable”.
Into an assign activity, to a variable type Dictionary(of string, object), I assigned:
(From column As DataColumn In row.Table.Columns.Cast(Of DataColumn)()
Select Key = column.ColumnName, Value = row(column.ColumnName)).ToDictionary(Function(x) x.Key, Function(x) x.Value)
As you can see the key will be de column name and de value will be the row value in that column.
This was useful for me in order to serialize this dictionary as a json and put this in a queue item. Lets see what this will bring when the moment comes for the performer to handle this element. Anyway, thanks for sharing your knowledge.