# Edit UProperty variable in array of UStruct on PostEditChangeProperty

**URL:** <https://forums.unrealengine.com/t/edit-uproperty-variable-in-array-of-ustruct-on-posteditchangeproperty/310113>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 9, 2015, 10:42am UTC](https://forums.unrealengine.com/t/edit-uproperty-variable-in-array-of-ustruct-on-posteditchangeproperty/310113 "2015-03-09T10:42:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_8ed3faa1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8ed3faa1](https://forums.unrealengine.com/u/anonymous_user_8ed3faa1)\
**Post date:** [March 9, 2015, 10:42am UTC](https://forums.unrealengine.com/t/edit-uproperty-variable-in-array-of-ustruct-on-posteditchangeproperty/310113/1 "2015-03-09T10:42:00Z")

</div>

Hi,

I have a custom actor component which contains an array of UStruct.  
I want to be able to validate some changed property in an element of that array of UStruct.

1. where should it validate the property change?

I couldn’t find any function that would be called to specify if a change is valid or not, before applying the property change.  
Currently I’m trying to do it in PostEditChangeProperty() instead.

Is it a proper location to “invalidate” a property change?

I already verified that each property change in an element of the struct array seems to trigger a proper call to PostEditChangeProperty() in the UActorComponent.

1. in PostEditChangeProperty(), any idea how I could get from the FPropertyChangedEvent or UProperty object, the actual element or element index in the array whose property is being changed?

Thanks in advance,

Max

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8ed3faa1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8ed3faa1](https://forums.unrealengine.com/u/anonymous_user_8ed3faa1)\
**Post date:** [March 10, 2015, 10:46am UTC](https://forums.unrealengine.com/t/edit-uproperty-variable-in-array-of-ustruct-on-posteditchangeproperty/310113/2 "2015-03-10T10:46:43Z")

</div>

For anyone who might encounter a similar issue:

- use PostEditChangeChainProperty() instead of PostEditChangeProperty()
- use GetArrayIndex() on the FPropertyChangedChainEvent parameter to get the element index whose property is being changed
- resetting the changed property value directly (from the struct element accessed using the index) when it wasn’t considered valid, seems to work =\> I’m not sure if this breaks some Undo / Redo logic though …

Max
