Hi experts,
I would like to know how I can use append item to list activity if I dont refer to column name but to column index.
Firstly I use Read range workbook activity to group data from excel sheet by specific column. I cant use column name because in excel sheet are two duplicated column names so I refers to column index r(8) (column on eighth position). Then I want to send single separately emails for grouped data in datatable:
So I need Append Item To List activity to collect data to list based on defined columns and then put it to datable. “Item to append” field I use usually CurrentRow(“Personnel Number”).ToString and other colums which I would like to append to list. But it will not work because I didnt refer to columns names in first part but to column index, so how I can define “Item to append” field with column index? I try to change field to CurrentRow r(0).ToString but it cause error.
Thank you so much CurrentRow(0).ToString works as expected.
Regarding group by and send email, if I group by like on shared WF screenshots above:
dictGroup=dtGroup.AsEnumerable.GroupBy(Function(r) r(6).ToString).ToDictionary(Function(g) g.Key,Function(g) g.CopyToDataTable)
so it is example of my results that data was grouped: by column 6 (it is email reciever)
Column 4------Column 5 (cc email)-------------Column 6 (email reciepent)
A-----------AnotherReciever5@emai.com--------Reciever1@email.com
B-----------AnotherReciever6@emai.com--------Reciever1@email.com
C-----------AnotherReciever7@emai.com--------Reciever2@email.com
maybe I need assign new value and then put to “CC” send email activity?
CC_Email = dtEmail.AsEnumerable.ToDictionary(Function(r) r(6).ToString,Function(r) r(5).ToString)
in this case column 6 will be vlookuped to column 5 in dictionary and in field “CC” will be CC_Email(currentitem.key). But it cause error Assign: An item with the same key has already been added. becuase in column6 and column5 could be duplicated emails.
One thing regarding datatable- if I append item to list, it will collect data in string and then creates datatble that is then send in email body, I used activity to convert datatable to HTML text- it changes format of date from 31.12.2025 to 01/31/2025 00:00:00 , so probably change date format from excel sheet to text- is it possible to not change format of date? If is possible to defined format CurrentRow(4).ToString to dd.mm.yyyy?