Reading a DataTable's Values with Python

Hello and thanks, I’m trying to read the values of my datatables using Python and can’t figure out the last step to actually read the value from a row struct:

DataTable = ItemTable
DataTableRowStuct = FItemTable
RowName = “test”
RowValue = “Name”

DT = unreal.DataTable(name=“ItemTable”)
row = unreal.DataTableRowHandle(data_table=DT,row_name=“test”)

This is as far as I can get. Could anyone please help me figure out how to get the value of “Name” from the row? I’ve tried a number of things like: row.get_editor_property(“Name”) but have had no success I’m assuming that some kind of cast is needed?

hi,
do you find how ?
i am also interested

have a nice day
Daniel

Apology for the delayed response. No I was unable to find out how to do this, and asked around and researched it quite a bit. It seems like something that should be fairly common to do in Python so I’m surprised the information isn’t there.

I solved this in a very unfun and heavy way by stopping using python all together and made a C++ editor module plugin which was able to access DataTables.

1 Like

I had some luck using unreal.DataTableFunctionLibrary

If you know your column name, something like this could work

col_name = "Location"    
row_names = unreal.DataTableFunctionLibrary.get_data_table_row_names(dt)
positions = unreal.DataTableFunctionLibrary.get_data_table_column_as_string(dt, col_name)
    for idx, col in enumerate(positions):
        print(f"{row_names[idx]} - {col_name}: {col}")
2 Likes