# How to access a DataTable using an enum

**URL:** <https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747>\
**Category:** Community & Industry Discussion\
**Tags:** datatable, ENUM, unreal-engine, question\
**Created:** [September 22, 2020, 10:48am UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747 "2020-09-22T10:48:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdBennett](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EdBennett](https://forums.unrealengine.com/u/EdBennett)\
**Post date:** [September 22, 2020, 10:48am UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/1 "2020-09-22T10:48:35Z")

</div>

Hi

I’m trying to pull an animation from a data table I have made and I was trying to use a enum saved as a variable so that the correct row could be set easily. However I do not seem to be able to get this to work.

I does however work if I select the row name manually.

So for example this works:

 ![314539-works.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/b/8eb39d2baf7569af3c3b7934996c65e09b09f204.png)

However this does not work:

 ![314540-doesnotwork.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/1/0712f5baa7ba193dce1f963d799400e53bfa34a0.png)

Any advice gratefully received.

Thanks

Ed

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 22, 2020, 11:08am UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/2 "2020-09-22T11:08:48Z")

</div>

You’ll be surprised once you try to print that Enum-\>Name 🙂

To make this particular conversion work, you’d need to go: enum → string → name.

Which is as horrible as it sounds.

---

<div class="post-metadata">

**Author:** ![EdBennett](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EdBennett](https://forums.unrealengine.com/u/EdBennett)\
**Post date:** [September 22, 2020, 11:16am UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/3 "2020-09-22T11:16:59Z")

</div>

Wow that worked, Thanks so much.

---

<div class="post-metadata">

**Author:** ![dliubash](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dliubash](https://forums.unrealengine.com/u/dliubash)\
**Post date:** [January 8, 2021, 3:50pm UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/4 "2021-01-08T15:50:10Z")

</div>

It won’t work in a packaged game, display enum names are editor-only

---

<div class="post-metadata">

**Author:** ![SrHayami](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SrHayami](https://forums.unrealengine.com/u/SrHayami)\
**Post date:** [January 12, 2023, 2:46am UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/5 "2023-01-12T02:46:51Z")

</div>

Thank you very much, it has worked wonderfully for me. 👏 👏 👌

---

<div class="post-metadata">

**Author:** ![MEXpartan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MEXpartan](https://forums.unrealengine.com/u/MEXpartan)\
**Post date:** [August 12, 2023, 6:58am UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/6 "2023-08-12T06:58:39Z")

</div>

I can’t believe I wasted an entire day trying to figure out what was wrong with my code using this conversion. Just now I’m finding that this engine bug has been going on since UE4.7. I am currently using UE5.2

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [August 17, 2023, 8:40pm UTC](https://forums.unrealengine.com/t/how-to-access-a-datatable-using-an-enum/471747/7 "2023-08-17T20:40:03Z")

</div>

It’s not a bug. A name and a string are two different data sets, though they are compatible for ease of use. An enum will convert to string instead of name, but you could also just use convert to name. The best solution is to create a struct of Names and then it wouldn’t be an issue because you don’t need to convert them.
