Help me to get this data in a dictionary

as we take values from config file into a dictionary in Robotic enterprise framework, I want the same logic but in my scenario config file is in different format. values are rowwise, i.e , there is a single row for a single execution of the BOT

1 Like

plz help its urgent
I want store all the cell values for all rows in arguements


Sorry i didn’t get you. Could you please tell more details about the issue.

Do you mean each BOT will read one row and perform actions ?

even in that case
we can create a dictionary variable with column name of datatable as KEY and the value of those columns in one row as VALUES
but that dictionary variable can be created only for one row because if we iterate again to the second row, the same key name i.e., same column name will get repeated and duplicate keys are not allowed in dictionary
would you like get the dictionary variable for one row at a time and make use of it for the current transaction and once that is done get the second row and create a new dictionary variable…

Cheers @Gaurav07

1 Like


Check this xaml, it will read an excel file and convert each row in a dictionary.
If you done with that row, before looping it again for second row clear the dictionary with “Clear Dictionary” activity. That is not included in this xaml.

ConvertDataRow2Dictionary.xaml (6.4 KB)

1 Like

yes it will read the last row everytym

I want the conversion for the last row only and then use the dictionary in_config like this for accessing column values
in_config(“Laycan”) =9/11/2019

I can get the index of last row using this

suppose I have 9 rows the above syntax will give me 9 then how can I make the dictionary for last row having index 9


You can get like that,

dtExcel.Rows(dtExcel.Rows.Count-1).Table.Columns.Cast(Of DataColumn)().ToDictionary(Function© c.ColumnName, Function© dtExcel.Rows(dtExcel.Rows.Count-1)©)