I am creating an anonymous object using lamda expression and assigning to the IEnumerable type variable.
Below lamda exp x is the datarow type from the datacolumn and Key.Value is the value from country column and index is one of the input parameter to the select method.Assigning to Ienumerable
dt1.AsEnumerable.Select(Function(x,y) New With {Key.Index =y, Key.Value = x(“Countries”).ToString})
When i loop through the collection i don’t see the properties(Index and Value) defined in the anonymous type but i am able to get the all the values like below
Hope i didn’t misunderstood your query
If you use the enumerable in the for each it will automatically get the next next data with iteration you don’t need a index.
If you need to pass it with index
you should use like enumAnany(0) something like this
If i misunterstood your query kindly explain me a bit more
Or if you are asking like you need to have it like a dictionary
If I understood your query correctly, you are saying that intellisense isn’t bringing up the properties/attributes you have created for the object in the For Each Activity i.e.
currentItem.Index
currentItem.Value
If that is the case, then you have to understand that this is a limitation from UiPath.
The for each isn’t intelligent enough to understand this, but if you wish to actualize this then you must use this code within an Invoke Code Activity and create the anonymous object there.