# How to add a Struct Array to Scroll Box

**URL:** <https://forums.unrealengine.com/t/how-to-add-a-struct-array-to-scroll-box/346684>\
**Category:** UI\
**Tags:** Struct, inventory, add, unreal-engine, Array, Widget, question\
**Created:** [February 7, 2016, 7:55am UTC](https://forums.unrealengine.com/t/how-to-add-a-struct-array-to-scroll-box/346684 "2016-02-07T07:55:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Overwatch04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Overwatch04](https://forums.unrealengine.com/u/Overwatch04)\
**Post date:** [February 7, 2016, 7:55am UTC](https://forums.unrealengine.com/t/how-to-add-a-struct-array-to-scroll-box/346684/1 "2016-02-07T07:55:37Z")

</div>

I have a scroll box for my inventory and added buttons (InventoryButton2 widget) with an image, a text description, and a quantity on. This part works:

![77670-menu.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/a/30a892495472ed99924e0a460141cb695fff4517.jpeg)

 ![77674-scrollbox.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/5/de5b26f90a63cc99f6b8c2523f1691d3264e9d04.jpeg)

 ![77675-makebutton.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/5/7e592c1bcba29bb8632a64c0cb43264aa6adc566.jpeg)

The buttons are getting their info from an Inventory structure I made (InventoryButtonScruct) stored in the “InventoryMenu” widget. As a default I have the two buttons shown already added to the structure when the game starts.

What Does not work:  
I am trying to add more items/buttons to the scroll box in-game. In my Shotgun Shell box blueprint I have Item info, which is an inventory struct that had an image, text, and quantity set. I am trying to add it to the scroll box when you use the use key.

 ![77671-shellsinventory.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/9/f0965d9b85ed850b8f96a7fda0d26b20bdee92e9.jpeg)

Can anyone see what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![Overwatch04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Overwatch04](https://forums.unrealengine.com/u/Overwatch04)\
**Post date:** [February 7, 2016, 3:38pm UTC](https://forums.unrealengine.com/t/how-to-add-a-struct-array-to-scroll-box/346684/2 "2016-02-07T15:38:18Z")

</div>

Is this what you mean? This does not seem to work either. The problem I see with this is that it still needs to add it to the struct since that is the inventory.

 ![77713-button.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/2/0c2db284a45aa05ea1ff8ce917ac7f3d337f6057.jpeg)

---

<div class="post-metadata">

**Author:** ![Overwatch04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Overwatch04](https://forums.unrealengine.com/u/Overwatch04)\
**Post date:** [February 7, 2016, 7:04pm UTC](https://forums.unrealengine.com/t/how-to-add-a-struct-array-to-scroll-box/346684/3 "2016-02-07T19:04:53Z")

</div>

Figured it out. I put the inventory struct in my game instance BP and just cast to it with the button information then it added perfectly! I left the rest of it the same so when you open the inventory it will for each loop the array and create all the buttons!
