# User Defined Structure Property names appear mangled on reflection

**URL:** <https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448>\
**Category:** Rendering\
**Tags:** properties, Struct, reflection, unreal-engine, question, CPP\
**Created:** [September 11, 2014, 5:26pm UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448 "2014-09-11T17:26:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruminant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ruminant](https://forums.unrealengine.com/u/Ruminant)\
**Post date:** [September 11, 2014, 5:26pm UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/1 "2014-09-11T17:26:38Z")

</div>

I’m using reflection with User Defined Structures (created in Blueprint) and am finding that when iterating through the properties, they all have extended names. For example, “Foobar” as seen in the editor, reads back as “Foobar\_1\_b24e4343a32434fe343434” from the UProperty.

I’ve taken the tactic of chopping back the extra information - but wanted to know if there was a correct way to read back the property names.

I iterate through the structure like this:

```
for(TFieldIterator<UProperty> PropIt(StructProperty->Struct); PropIt; ++PropIt)
{
    UProperty* Property = *PropIt;
    // Property->GetName() here returns "name_1_1fe456ef5e6ea7b7bc" instead of "name"
   ...
}

```

It’s not a major problem, since the workaround appear to be “chop back two underscores”, but that feels a little ugly.

---

<div class="post-metadata">

**Author:** ![lmm\_loli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lmm\_loli](https://forums.unrealengine.com/u/lmm_loli)\
**Post date:** [June 19, 2015, 3:36am UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/2 "2015-06-19T03:36:48Z")

</div>

I have same problem = =#

---

<div class="post-metadata">

**Author:** ![brad4ever](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brad4ever](https://forums.unrealengine.com/u/brad4ever)\
**Post date:** [July 10, 2015, 10:15pm UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/3 "2015-07-10T22:15:57Z")

</div>

me too since GetDisplayNameText is not valid in non #WITH\_EDITOR builds

---

<div class="post-metadata">

**Author:** ![broly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@broly](https://forums.unrealengine.com/u/broly)\
**Post date:** [March 14, 2017, 8:49am UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/4 "2017-03-14T08:49:46Z")

</div>

I have some problem too

---

<div class="post-metadata">

**Author:** ![W1M0R](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@W1M0R](https://forums.unrealengine.com/u/W1M0R)\
**Post date:** [June 1, 2019, 9:37am UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/5 "2019-06-01T09:37:30Z")

</div>

Use the [UStruct::PropertyNameToDisplayName](https://api.unrealengine.com/INT/API/Runtime/CoreUObject/UObject/UStruct/PropertyNameToDisplayName/index.html) or [UField::GetDisplayNameText](https://docs.unrealengine.com/en-US/API/Runtime/CoreUObject/UObject/UField/GetDisplayNameText/index.html) functions, in which case your example would look something like this:

```
auto Struct = StructProperty->Struct;
for(TFieldIterator<UProperty> PropIt(Struct); PropIt; ++PropIt)
{
     auto Property = *PropIt;
     auto DisplayName1 = Struct->PropertyNameToDisplayName(Property->GetFName())
     auto DisplayName2 = Property ->GetDisplayNameText().ToString();
    ...
}

```

---

<div class="post-metadata">

**Author:** ![W1M0R](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@W1M0R](https://forums.unrealengine.com/u/W1M0R)\
**Post date:** [June 1, 2019, 9:38am UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/6 "2019-06-01T09:38:20Z")

</div>

Hey everyone, see my answer to the question, that should help you out.

---

<div class="post-metadata">

**Author:** ![Ruminant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ruminant](https://forums.unrealengine.com/u/Ruminant)\
**Post date:** [June 5, 2019, 5:43pm UTC](https://forums.unrealengine.com/t/user-defined-structure-property-names-appear-mangled-on-reflection/293448/7 "2019-06-05T17:43:08Z")

</div>

Thank you very much good sir - marked as the correct answer.
