Help with storing data table references in array's or struct's and access struct members

i’ve been trying to store data table references in structs and Tarrays so i can access them in multiple classes, functions etc, but i’ve been having problem with storing the references in both the structs and arrays, example code below

Arrays
.h file
TArray DT;

UClass()
class UMrClass{
UMrClass();
}

.cpp file
UMrClass::UMrClass(){
static ConstructorHelpers::FObjectFinder Test(TEXT(“/Game/Path/TestDT”));
if (Test.Succeeded()) {
DT.Add( Test.Object);
}

The above code dosen’t work

Structs
.h files
UStruct()
struct FTester{
class UDataTable* Test;
FTester();
}

.cpp file
FTester::FTester(){
static ConstructorHelpers::FObjectFinder Test(TEXT(“/Game/Path/TestDT”));
if (Test.Succeeded()) {
Test = Test.Object;
}
}

FTester DT;

wasn’t able to access members through the above object

TArray ADT;

Wasn’t able to access the member through the above array

if any one can explain how to store references in structs or arrays and if possible cleaner way to access the members in a struct then the const method way, since i need to store alot of references

Hello! Just create some struct like this

#include "Engine/DataTable.h"
#include "MyData.generated.h"

USTRUCT(BlueprintType)
struct PROJECT_API FMyData: public FTableRowBase {

	GENERATED_USTRUCT_BODY();

	FMyData() {
		Name = FText::GetEmpty();
		Description = FText::GetEmpty();
	}

	UPROPERTY(EditAnywhere)
		FText Name;

	UPROPERTY(EditAnywhere)
		FText Description;
};

After that you can just create data table around it and use it everywhere…