# String to Enum blueprint

**URL:** <https://forums.unrealengine.com/t/string-to-enum-blueprint/350341>\
**Category:** Blueprint\
**Tags:** convert, enumeration, string, ENUM, unreal-engine, Blueprint, question\
**Created:** [March 12, 2016, 1:00pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341 "2016-03-12T13:00:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jojii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jojii](https://forums.unrealengine.com/u/Jojii)\
**Post date:** [March 12, 2016, 1:00pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/1 "2016-03-12T13:00:07Z")

</div>

Hello,

is it possible to select from a String an enum, so that I give a String and get an enum in blueprint?

Thanks. Jojii.

---

<div class="post-metadata">

**Author:** ![Sentura](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentura](https://forums.unrealengine.com/u/Sentura)\
**Post date:** [March 12, 2016, 1:18pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/2 "2016-03-12T13:18:01Z")

</div>

You could try Set Value as Enum, but I’m not sure it has the same properties as if you were to parse a string as an enum. Otherwise, if you know C++ it wouldn’t be too hard to write a function that could parse enums.

![81894-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/7/d277fb660ea587f6efd3466ec340b2f452fdc437.png)

---

<div class="post-metadata">

**Author:** ![Jojii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jojii](https://forums.unrealengine.com/u/Jojii)\
**Post date:** [March 12, 2016, 2:56pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/3 "2016-03-12T14:56:15Z")

</div>

I know programmlanuages like java and so on, I know the basics of C++, but I can’t programm this in UE4

---

<div class="post-metadata">

**Author:** ![Sentura](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentura](https://forums.unrealengine.com/u/Sentura)\
**Post date:** [March 12, 2016, 7:09pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/4 "2016-03-12T19:09:16Z")

</div>

Have you at least tried to use Set Value as Enum?

---

<div class="post-metadata">

**Author:** ![Jojii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jojii](https://forums.unrealengine.com/u/Jojii)\
**Post date:** [March 12, 2016, 10:06pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/5 "2016-03-12T22:06:08Z")

</div>

I don’t use Blackboards or Behaivour Trees, or does this not matter?

---

<div class="post-metadata">

**Author:** ![Sentura](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentura](https://forums.unrealengine.com/u/Sentura)\
**Post date:** [March 13, 2016, 1:11am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/6 "2016-03-13T01:11:43Z")

</div>

Right - my bad. It may be that you could hack a parse if you had a blackboard component and used the function, but otherwise I don’t think it’s plausible to do in blueprints.

---

<div class="post-metadata">

**Author:** ![Jojii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jojii](https://forums.unrealengine.com/u/Jojii)\
**Post date:** [March 13, 2016, 10:19am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/7 "2016-03-13T10:19:27Z")

</div>

Ok, do you have any idea, how to do this in C++ or do you know a good tutorial, which include things like these?

---

<div class="post-metadata">

**Author:** ![Sentura](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentura](https://forums.unrealengine.com/u/Sentura)\
**Post date:** [March 13, 2016, 10:21am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/8 "2016-03-13T10:21:32Z")

</div>

> <https://stackoverflow.com/questions/726664/string-to-enum-in-c>

---

<div class="post-metadata">

**Author:** ![Jojii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jojii](https://forums.unrealengine.com/u/Jojii)\
**Post date:** [March 13, 2016, 10:22am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/9 "2016-03-13T10:22:12Z")

</div>

thanks. 🙂

---

<div class="post-metadata">

**Author:** ![Jojii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jojii](https://forums.unrealengine.com/u/Jojii)\
**Post date:** [March 13, 2016, 10:23am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/10 "2016-03-13T10:23:44Z")

</div>

Do you have so good answers, on my other questions, which nobody answers?

---

<div class="post-metadata">

**Author:** ![Sentura](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentura](https://forums.unrealengine.com/u/Sentura)\
**Post date:** [March 13, 2016, 10:25am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/11 "2016-03-13T10:25:57Z")

</div>

If you feel that this has answered your question, please mark the question as answered.Thanks! =)

---

<div class="post-metadata">

**Author:** ![giffen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@giffen](https://forums.unrealengine.com/u/giffen)\
**Post date:** [October 6, 2016, 3:10pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/12 "2016-10-06T15:10:00Z")

</div>

![109883-string+to+enum.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/d/90d0836e06244c5252110d3d22e51cb4893b2e5c.png)

This is how I did it, but it requires a new function for each enum.

---

<div class="post-metadata">

**Author:** ![Xenon2112](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xenon2112](https://forums.unrealengine.com/u/Xenon2112)\
**Post date:** [June 9, 2018, 8:29pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/13 "2018-06-09T20:29:24Z")

</div>

This is my solution. It’s a bit clumsy, but it gets the job done, allowing you to reference thereafter and use Enum-based switches. I’m just going to change it around a bit to tell me if it can’t find one of the enum entries to match the name.

 ![243717-assigning-enum-based-on-string.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/a/62a9b132dd950298b889d22f75bcf0d1834b1ec1.png)

---

<div class="post-metadata">

**Author:** ![Wobbleyheadedbob](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wobbleyheadedbob](https://forums.unrealengine.com/u/Wobbleyheadedbob)\
**Post date:** [June 19, 2018, 6:31pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/14 "2018-06-19T18:31:02Z")

</div>

Bit late to the party, but this works for me.

 ![244825-enum-from-combobox.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/2/4721e0e0370e741e6108834e36ed54d6365a1d47.png)

---

<div class="post-metadata">

**Author:** ![DoomCross](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DoomCross](https://forums.unrealengine.com/u/DoomCross)\
**Post date:** [August 11, 2023, 6:11pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/15 "2023-08-11T18:11:28Z")

</div>

Just in case someone was struggling as hard as me. Here’s the code that will allow you to set your Enum variables using a String input. Don’t know how useful this can be, but there you go.

My main method to set any prop from a given string and prop name, the Enum portion highlighted at the bottom

 ![byte_11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/2/8c2eaacaaac261c58026e7a72bf96775bf26366b.png)

The actual code to set the Enum as Byte

 ![byte_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/f/dcf68ef95a4162741f4852b5ad76f71d223ef6c1.png)

---

<div class="post-metadata">

**Author:** ![ruigol](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ruigol/32/964789_2.png) [@ruigol](https://forums.unrealengine.com/u/ruigol)\
**Post date:** [June 25, 2024, 10:16am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/16 "2024-06-25T10:16:03Z")

</div>

Late to the party as well but I find a simple function like this does it for me:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/2/fd27f013addbee231efe10c8c01c962040500443.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/7/bb714e387c9456c8b1cb4d96cac2b5b238609ffa.png)

---

<div class="post-metadata">

**Author:** ![DarkGate4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarkGate4](https://forums.unrealengine.com/u/DarkGate4)\
**Post date:** [September 7, 2024, 6:38am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/17 "2024-09-07T06:38:57Z")

</div>

It might be easier to use a map. The key can either be a name or string, and the value is the enum.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/8/968d5bd7aa1e405e365a37ecf02a074a94881d11.png)

---

<div class="post-metadata">

**Author:** ![VioletSaint](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/violetsaint/32/88710_2.png) [@VioletSaint](https://forums.unrealengine.com/u/VioletSaint)\
**Post date:** [September 14, 2024, 1:37pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/18 "2024-09-14T13:37:13Z")

</div>

Thank you! Good idea.

---

<div class="post-metadata">

**Author:** ![nbixel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nbixel](https://forums.unrealengine.com/u/nbixel)\
**Post date:** [August 18, 2025, 8:18pm UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/19 "2025-08-18T20:18:17Z")

</div>

I started to use your example, but then reversed the logic, I think it is much faster with less setup

 ![String to Enum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/1/f11f265fc2ba27bb7c4ef70bca01aef5d8bc53f4.png)

---

<div class="post-metadata">

**Author:** ![ruigol](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ruigol/32/964789_2.png) [@ruigol](https://forums.unrealengine.com/u/ruigol)\
**Post date:** [August 26, 2025, 11:38am UTC](https://forums.unrealengine.com/t/string-to-enum-blueprint/350341/20 "2025-08-26T11:38:13Z")

</div>

@nbixel Yeah, this is how I would code it nowadays
