How to create a struct from its member reference ? C++

Hi, I want to know how I can create a struct from its member reference ?

after creating it I want to set/add data to it
image_2022-08-07_061432064

.

I tried this but it always failed.

.h

UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TArray<FST_ItemTypeAndID> StructArrayRef;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
FST_ItemTypeAndID StructRefTemp;

.cpp

StructArrayRefTemp.ID = //my data
StructArrayRefTemp.Type = //my data

StructArrayRef.Add(StructRefTemp);//Adding elements

Do I understand correctly, that your struct is defined in Blueprint? In this case, I recommend to move your struct definition to the C++ side, so you can easily have access in C++ as well as in Blueprint.

Sir thank you for reply, my FST_ItemTypeAndID i s already defined in C++ side in class MyItemsGroups.h

USTRUCT(BlueprintType)
struct FST_ItemTypeAndID : public FTableRowBase
{
	GENERATED_BODY()
	
public:
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	EItemType Type;
	
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
	FName ID;
};

Here is the full code of this issue, I think I am getting infinite loop because of this failed cast to struct.
Infinite Loop