Finding out datatable row count?

Quick question, does anyone know how to get the data table row count?

I am trying to add a percentage to the progress bar divided by the amount of rows in a data table and I can’t seem to figure it out how to get the amount of rows of the data table with only blueprints, any help is much appreciated.
(Not being able to do so in just blueprints is also an answer on my question so don’t hesitate to comment!)

Many thanks in advance.

2 Likes

Get Data Table Row Names - Length of array.

7 Likes

Use UDataTable::GetRowNames().

int rowCount = TargetDatatable->GetRowNames().Num();

5 Likes

Please DO NOT use GetRowNames() function. It allocates whole array of names just for you to extract the count and then throw it away.

Use GetRowMap() which returns reference to the map the name array is actually being generated from, so you can call Num() on that just the same without useless allocations.

2 Likes