Can I write to a Data Table?

For everyone looking to write to a Data Table during editor time:

FDataTableEditorUtils::AddRow(UDataTable* DataTable, FName RowName)

shows what you need to do. The important lines are:

FDataTableEditorUtils::BroadcastPreChange(DataTable, EDataTableChangeInfo::RowList);
DataTable->Modify();

// Do your DataTable.AddRow(RowName, SomeNewRow);

FDataTableEditorUtils::BroadcastPostChange(DataTable, EDataTableChangeInfo::RowList);
3 Likes