# UDataTable pointer of specific type

**URL:** <https://forums.unrealengine.com/t/udatatable-pointer-of-specific-type/479992>\
**Category:** Community & Industry Discussion\
**Tags:** Struct, datatable, unreal-engine, Scripting, question\
**Created:** [March 9, 2021, 2:18pm UTC](https://forums.unrealengine.com/t/udatatable-pointer-of-specific-type/479992 "2021-03-09T14:18:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GenerationLost](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GenerationLost](https://forums.unrealengine.com/u/GenerationLost)\
**Post date:** [March 9, 2021, 2:18pm UTC](https://forums.unrealengine.com/t/udatatable-pointer-of-specific-type/479992/1 "2021-03-09T14:18:01Z")

</div>

I need a reference to a data table, so a pointer to UDataTable, but I also need to differentiate the struct this table is using.

As an example, I’ve got multiple data tables that use the same struct that contains some character information. If I want to access the data table rows in Blueprint and I pass in the data table pointer to “Get Data Table Row” the output is a wildcard, since no “subtype” is specified in a UDataTable pointer and I cannot cast structs to the one I need.

So how would I define a variable in C++ that represents a UDataTable that uses a specific struct as base?

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [September 30, 2022, 12:53pm UTC](https://forums.unrealengine.com/t/udatatable-pointer-of-specific-type/479992/2 "2022-09-30T12:53:16Z")

</div>

You can do it with meta tags in the UPROPERTY macro:

If your structure is called FStructName you have to remove the F in the tag:

```auto
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(RequiredAssetDataTags = RowStructure=StructName))
UDataTable *DataTableName;

```

If you need to do it for a Row Handle you need to use this:

```auto
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(RowType="StructName"))
FDataTableRowHandle RowHandle;

```

I noticed that these metatags don’t work inside other structs, so if you need to pass a specific DataTable type inside a struct it doesn’t work

---

<div class="post-metadata">

**Author:** ![Ares9323](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ares9323/32/1194521_2.png) [@Ares9323](https://forums.unrealengine.com/u/Ares9323)\
**Post date:** [February 24, 2025, 11:28pm UTC](https://forums.unrealengine.com/t/udatatable-pointer-of-specific-type/479992/3 "2025-02-24T23:28:56Z")

</div>

> [@Ares9323](#):
>
> ```auto
> UPROPERTY(EditAnywhere, BlueprintReadWrite, 
> meta=(RequiredAssetDataTags = RowStructure=StructName))
> UDataTable *DataTableName;
> 
> ```

Since after 2 years this is no longer up to date, here’s the new syntax:

```auto
UPROPERTY(EditAnywhere, BlueprintReadWrite, 
meta=(RequiredAssetDataTags = "RowStructure=/Script/ModuleName.StructName"))
UDataTable *DataTableName;

```
