Count the number of occurence

I’m trying to count/group the same occurence together but i kept getting the error message at the “assign” step “Object reference not set to an instance of an object”. Do you know what the reason is?

The input file
image

image

Thank you!

You haven’t initialized the dt_final… datatable. In the variables pane, put:

New System.Data.DataTable

…into the Default.

ensure:

  • dtInputlist is not null, populated and has the column Name (without surrounding spaces…)
  • dt_finaltable is initialized and defining two columns

You can check also by debugging and
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

dtInputlist
dtInputlist .Columns
dt_finaltable

Variation of the code: as by your second screenshot is more recommended

Thank you. I think I got it