Hi everyone
I want to add a value to a list (or an array doesn’t matter)
by using for each row and taking the value with [row(“column name”).tostring] - its working
But I don’t know how to enter the value into the list without deleting the value inside
Hi
did we try with ADD TO COLLECTIONS activity where in the collections mention the list variable and in the item property mention the element you want to add and change the type argument accordingly
we can do this validation in a IF condition and if true it will go to THEN part where we can use a ADD TO COLLECTIONS activity
in that activity under collections property mention as list_Variable which is of type System.Collections.Generic.List(of string) and with default value as New List(of string)
and in the item properrty mention as row(“yourcolumnname”).ToString and in the type argument property mention as string
ok, so you can do with an Assign after creating a list variable like this: MyList = (From r As DataRow In dt.Rows.Cast(Of DataRow)() Where CStr(r.Item("Codes")) ="mycode" Select CStr(r.Item("MyColumn"))).ToList
Fine
may i know the issue now on using this
to check the count of elements in that list use this expression in a writeline activity like this listvariablename.Count.ToString
the Add To Collection doesn’t work, this is the problem:
“Add To Collection: The property ‘Collection’ of ‘Add To Collection’ is not initialized.”
In the Collection I created this variable “PolicyNumList”
In Item i wrote this “row2(“מספר פוליסה”).ToString”
And in the TypeArgument I chose String
being inside the FOR EACH ROW loop, for each iteration it will add the ellements to that list which obviously means all values will be added to the list once after the validation inside the IF condition
its like this
I have a customer that have couple of policies (insurances)
and I want the list to be only the policy number that connected to the same agent
and when I run the foreachrow, the if checks this and put it inside the list
but in the next run of the outer loop the agent number is changing and it will add another instance to the list that connected to the other agent
and what I want to happen is that each list will be an empth one - that only 1 agent number will be connected to the list