# Adding entries to TMap fails due to duplicate defaults

**URL:** <https://forums.unrealengine.com/t/adding-entries-to-tmap-fails-due-to-duplicate-defaults/386112>\
**Category:** Blueprint\
**Tags:** unreal-engine, bug-report, editor, Blueprint, question\
**Created:** [February 25, 2017, 2:37am UTC](https://forums.unrealengine.com/t/adding-entries-to-tmap-fails-due-to-duplicate-defaults/386112 "2017-02-25T02:37:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KVogler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KVogler](https://forums.unrealengine.com/u/KVogler)\
**Post date:** [February 25, 2017, 2:37am UTC](https://forums.unrealengine.com/t/adding-entries-to-tmap-fails-due-to-duplicate-defaults/386112/1 "2017-02-25T02:37:35Z")

</div>

Hi,

I just noticed a little bug with the TMap blueprint editor tab:

When you define a TMap variable and the key happensto be an Enum, you are forced to define the first enum value as last. Otherwise, a click on the plus sign will attempt to create a new entry with the default which was already declared.

So, to reproduce:

1. Create a BP, based on actor
2. Create an Enum and add the Values “Alice”, “Bob” and “Timmy”
3. Create a variable of the TMap type in the blueprint and pick a TMap value type (for example Static Mesh)
4. Add an item to the variable in the etails panel. An entry for “Alice” will be created
5. Click again on “+” to add another entry
6. This fails as another entry with the default value “Alice” already exists
7. Change the first entry key to “Bob”
8. Click again on “+”. This time it will work and a new entry with “Alice” as default is created.

Its a bit annoying this way.  
Maybe that check on duplicates could be done on BP compile time, or intelligently pick an unused enum value for new entries?

Cheers,  
Klaus

---

<div class="post-metadata">

**Author:** ![BananaKing932](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BananaKing932](https://forums.unrealengine.com/u/BananaKing932)\
**Post date:** [February 25, 2017, 11:14am UTC](https://forums.unrealengine.com/t/adding-entries-to-tmap-fails-due-to-duplicate-defaults/386112/2 "2017-02-25T11:14:13Z")

</div>

+1

I have this same exact issue.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [March 1, 2017, 8:49pm UTC](https://forums.unrealengine.com/t/adding-entries-to-tmap-fails-due-to-duplicate-defaults/386112/3 "2017-03-01T20:49:14Z")

</div>

Hey KVogler and BananaKing932,

This is a known issue previously reported [here](https://answers.unrealengine.com/questions/561128/blueprint-map-not-working.html). It doesn’t just happen with Enums but pretty much all variable types.

We have it logged as [JIRA UE-41910](https://issues.unrealengine.com/issue/UE-41910).

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![KazemAkhgary](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KazemAkhgary](https://forums.unrealengine.com/u/KazemAkhgary)\
**Post date:** [September 8, 2019, 4:28pm UTC](https://forums.unrealengine.com/t/adding-entries-to-tmap-fails-due-to-duplicate-defaults/386112/4 "2019-09-08T16:28:55Z")

</div>

this is not solved yet. it’s annoying restriction. also the fact that we can not reorder item in the map makes it more annoying. I know that order in map does not matter but it matters visually when setting up values. order matters in developement. In runtime it can go in any order and it doesn’t matter
