I’m struggling to dynamically extract row data from Data Tables in Unreal Engine 5.4.4 using the Python API for my project. I need to read row data (e.g., SecondsPerYear from DT_GameConfig with struct ST_GameConfig) for any Data Table, including new structure classes, without manual mapping. The script correctly retrieves row types (e.g., ST_BuildInfo, ST_Job, ST_GameConfig) and row names (e.g., Shrub, Idle) but fails to access row field values, producing empty data fields in the output JSON.
What I’ve Tried:
I’ve attempted several Python API methods to access row data, all of which failed:
data_table.get_row(row_name):AttributeError: 'DataTable' object has no attribute 'get_row'.data_table.get_row_map():AttributeError: 'DataTable' object has no attribute 'get_row_map'.data_table.get_all_rows():AttributeError: 'DataTable' object has no attribute 'get_all_rows'.unreal.DataTableFunctionLibrary.get_data_table_row():AttributeError: type object 'DataTableFunctionLibrary' has no attribute 'get_data_table_row'.
# Function to get Data Table structure
def get_data_table_structure(data_table):
structure = {"row_type": "Unknown", "rows": []}
if data_table:
try:
# Get row structure (Row Type)
row_struct = data_table.get_row_struct()
structure["row_type"] = row_struct.get_name() if row_struct else "Unknown"
# Get row names
row_names = data_table.get_row_names()
# Load external row data (if available)
external_data = load_external_row_data()
table_name = data_table.get_name()
manual_data = external_data.get(table_name, {}).get("rows", {})
for row_name in row_names:
row_details = {}
# Try to use manual data if available
if str(row_name) in manual_data:
row_details = manual_data[str(row_name)]
unreal.log(f"Using manual row data for {row_name} in {table_name}")
else:
# Attempt dynamic row data access (placeholder, as API is limited)
unreal.log_warning(f"No dynamic row data access for {row_name} in {table_name}; consider adding to {external_data_file}")
structure["rows"].append({"name": str(row_name), "data": row_details})
except Exception as e:
unreal.log_error(f"Error getting Data Table structure for {data_table.get_name()}: {str(e)}")
try:
row_names = data_table.get_row_names()
for row_name in row_names:
structure["rows"].append({"name": str(row_name), "data": {}})
except Exception as e2:
unreal.log_error(f"Failed to get row names for {data_table.get_name()}: {str(e2)}")
return structure
This is the current output :
expected output :

