# Cannot modify member values of scruct contained in a map

**URL:** <https://forums.unrealengine.com/t/cannot-modify-member-values-of-scruct-contained-in-a-map/1384078>\
**Category:** International\
**Tags:** data, Struct, unreal-engine, Blueprint, question\
**Created:** [November 12, 2023, 9:03am UTC](https://forums.unrealengine.com/t/cannot-modify-member-values-of-scruct-contained-in-a-map/1384078 "2023-11-12T09:03:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Manusoka](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/manusoka/32/757572_2.png) [@Manusoka](https://forums.unrealengine.com/u/Manusoka)\
**Post date:** [November 12, 2023, 9:12am UTC](https://forums.unrealengine.com/t/cannot-modify-member-values-of-scruct-contained-in-a-map/1384078/2 "2023-11-12T09:12:31Z")

</div>

I found the solution while writting this post, and I wanted to leave the answer for future noobies like me to find it:

If you want to **overwrite** the key/value pair of a MAP, you have to add an element to the map using the key corresponding to the value you want to be overwritten. Just like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/c/4ecbd764149c24d7110887093eaa1633e17b1fdd.png)  
More specific:  
 ![Zoomed solution](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/f/e7fa1199aaeab9c1d187c6af8d6ddb5a338499f9.png)

Please, go give a like to this post, where I found the solution:

> [@Modifying "Value" in Maps](https://forums.unrealengine.com/t/modifying-value-in-maps/460940):
>
> You cannot do that this way as arrays indexis just order number in array (latterly memory position offset) it not a fixed key and can be changed result of some operations (like sorting, adding and removing elements), map needs value to be assicated with key. Map inside is work as array of TPair with extra code, C++ type which is not supported by blueprint, so map data can not really be interacted directly in blueprints. Get Values and Get Keys nodes just dumps data from TPairs in to separate arr…

Good luck, everyone!

---

_[View the full topic](https://forums.unrealengine.com/t/cannot-modify-member-values-of-scruct-contained-in-a-map/1384078)._
