# Data Tables and Structures?

**URL:** <https://forums.unrealengine.com/t/data-tables-and-structures/604557>\
**Category:** C++\
**Tags:** Struct, unreal-engine, UE4, question\
**Created:** [July 14, 2022, 7:17am UTC](https://forums.unrealengine.com/t/data-tables-and-structures/604557 "2022-07-14T07:17:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShadowSprite123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Post date:** [July 14, 2022, 7:17am UTC](https://forums.unrealengine.com/t/data-tables-and-structures/604557/1 "2022-07-14T07:17:41Z")

</div>

I’m trying to create a c++ data table using a c++ struct(USTRUCT inheriting from FTableRowBase) and wanted to know if and how I could implement the data table(in c++) using the struct I created in the same class. This is for an inventory system.

**DataTable.h**

```auto
USTRUCT()
struct ItemStructure : public FTableRowBase
{
	GENERATED_BODY()
		

	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		FText DisplayName;
	
	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		FText Description;

	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		UTexture2D Thumbnail;

	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		UStaticMesh Mesh;

	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		bool Stackable;
}

UCLASS()
class CPP_TEST_B_API UItemDataTable : public UDataTable
{
	GENERATED_BODY()
	

};

```

And thanks in advance!

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [July 14, 2022, 9:53pm UTC](https://forums.unrealengine.com/t/data-tables-and-structures/604557/2 "2022-07-14T21:53:20Z")

</div>

You don’t create DataTables in C++ because they are assets. DataTables are essentially just wrapper classes for TMap\<FName, FMyStruct\> - but store raw data and reinterpret it into the correct type.

You just need to create a new Data Table in the editor, and choose your struct as the type in the modal window that pops up. If you want to use that table in C++, you’ll need to store a reference to it somewhere.

There’s also a convenient FDataTableRowHandle type if you want to store a reference to a specific row of a data table, and UPROPERTY markup to limit the options to a given Row Type.
