# Cannot set up Datatable var in Blueprint

**URL:** <https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 15, 2015, 1:22am UTC](https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285 "2015-07-15T01:22:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cridia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cridia/32/772487_2.png) [@cridia](https://forums.unrealengine.com/u/cridia)\
**Post date:** [July 15, 2015, 1:22am UTC](https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285/1 "2015-07-15T01:22:20Z")

</div>

I am setting up an item system for which I am using datatables to store the data. Right now, I am trying to use that item system to have a blueprint staticmeshactor class detect whether the player is carrying specific items and to perform an action when the player does (eg. a key opening a door). Nothing too fancy.

Now, in order to be able to set which data table is used for each separate actor, I want to set up a variable that stores a datatable value. The problem is; I cannot find any way to do it. When setting up variables, the data table simply doesn’t appear as an option. When I use, for instance, the Get Data Table Row node, I cannot promote the Data Table to a variable either. I have also tried simply setting up a custom struct in C++ that stores a Data Table as a variable (with success), as well as making a new base class for the blueprint that includes a data table, but when I try to plug that one into the Get Data Table Row node, it says that it only supports “literal data tables.”

 ![50225-datatableerror.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/7/277d80438887d70f51520a25f92aeecac464cc3e.jpeg)

Is there any way I can setup a Datatable variable that I can use and alter based on a per-actor basis?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2ed5b4c7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2ed5b4c7](https://forums.unrealengine.com/u/anonymous_user_2ed5b4c7)\
**Post date:** [July 15, 2015, 7:39am UTC](https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285/2 "2015-07-15T07:39:34Z")

</div>

HI!

Now you do not need create custom class in C++. You can do all what you need with blueprints.

Look this tutorial: [- YouTube](https://www.youtube.com/watch?v=WLv67ddnzN0)

---

<div class="post-metadata">

**Author:** ![cridia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cridia/32/772487_2.png) [@cridia](https://forums.unrealengine.com/u/cridia)\
**Post date:** [July 15, 2015, 7:50am UTC](https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285/3 "2015-07-15T07:50:28Z")

</div>

Sorry, but that’s not what my question was. I know how to create a datatable, and know how to import one. I know how to set it in blueprint as well.

What I want to know is whether it is possible to set up a data table variable that allows me to set whatever datatable I want to use on a per blueprint basis. For instance, if I have a datatable with key items and a datatable with normal items, I want to set it as a blueprint variable whether the item uses the key item data table or the normal item data table. Without having to go back into the blueprint and setting all the nodes that reference the datatable manually.

When I was referring to the data table as a variable, I didn’t mean the particular datatable that I wanted to reference, but I meant a “datatable variable,” like a float variable or a boolean variable.

---

<div class="post-metadata">

**Author:** ![nonnib](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nonnib](https://forums.unrealengine.com/u/nonnib)\
**Post date:** [October 7, 2015, 2:21pm UTC](https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285/4 "2015-10-07T14:21:34Z")

</div>

Looks like this is being discussed here: [DataTableRowHandle to Get Data table row: Only literal data table is supported - Programming & Scripting - Unreal Engine Forums](https://answers.unrealengine.com/questions/172007/datatablerowhandle-to-get-data-table-row-only-lite.html)

By design I’m afraid. ☹

---

<div class="post-metadata">

**Author:** ![tkampa\_ps](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tkampa\_ps](https://forums.unrealengine.com/u/tkampa_ps)\
**Post date:** [October 26, 2016, 10:12pm UTC](https://forums.unrealengine.com/t/cannot-set-up-datatable-var-in-blueprint/325285/5 "2016-10-26T22:12:33Z")

</div>

If you are compiling engine, you can get data table as a variable type by doing the modification shown here, while you wait for 4.15.

> **[Data Table Blueprint Function Library](https://forums.unrealengine.com/showthread.php?126818-Data-Table-Blueprint-Function-Library)**
>
> Hi all! I wanted to share some of our blueprint table functions with the community. As with anything not supported by Epic, use at your own risk. The C++ blueprint function library is attached. Data Table as a Blueprint Variable Epic claimed this...
