# How to add one item to array?

**URL:** <https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445>\
**Category:** C++\
**Tags:** UE4-20, unreal-engine, UE4, question, CPP\
**Created:** [August 13, 2022, 1:39am UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445 "2022-08-13T01:39:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 13, 2022, 1:39am UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445/1 "2022-08-13T01:39:56Z")

</div>

how to add one item to array in C++ ?  
bp example:  
 ![image_2022-08-13_063118963](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/2/e/72e1fb4257b8292ded64b137d36d40eee2f84d09.png)

```auto
Arr.Add(MyItems.ItemOne);

```

the problem is the array takes all the items from `MyItems` instead of `ItemOne`

---

<div class="post-metadata">

**Author:** ![Archeo2002](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/archeo2002/32/560631_2.png) [@Archeo2002](https://forums.unrealengine.com/u/Archeo2002)\
**Post date:** [August 13, 2022, 2:07pm UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445/2 "2022-08-13T14:07:15Z")

</div>

What types are the array, MyItems and ItemOne?

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 13, 2022, 2:38pm UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445/3 "2022-08-13T14:38:12Z")

</div>

`MyItems` is the array of struct and it has one variable `ItemOne` of type FName which stores the name of the item

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 13, 2022, 2:40pm UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445/4 "2022-08-13T14:40:02Z")

</div>

concept in blueprints but it takes 2 variables `type` and `id`, mine is the same and mine takes one variable only `ID` of type FName

 ![image_2022-08-13_193929281](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/2/9b25ef9a07b8fb8db965efdc6179d6d5a3532a9d.png)

---

<div class="post-metadata">

**Author:** ![Archeo2002](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/archeo2002/32/560631_2.png) [@Archeo2002](https://forums.unrealengine.com/u/Archeo2002)\
**Post date:** [August 13, 2022, 6:46pm UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445/5 "2022-08-13T18:46:19Z")

</div>

Can you post the full snippet of your code?

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 13, 2022, 6:52pm UTC](https://forums.unrealengine.com/t/how-to-add-one-item-to-array/627445/6 "2022-08-13T18:52:15Z")

</div>

Sir this Issue is solve in this [SOLUTION](https://forums.unrealengine.com/t/why-my-gettablerownames-failed/627748)
