# DynamicArray add element

**URL:** <https://forum.algorand.co/t/dynamicarray-add-element/9702>\
**Category:** General\
**Tags:** teal, smart-contracts\
**Created:** [May 31, 2023, 9:32am UTC](https://forum.algorand.co/t/dynamicarray-add-element/9702 "2023-05-31T09:32:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatBarons](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@MatBarons](https://forum.algorand.co/u/MatBarons)\
**Post date:** [May 31, 2023, 9:32am UTC](https://forum.algorand.co/t/dynamicarray-add-element/9702/1 "2023-05-31T09:32:24Z")

</div>

Hi everyone,  
i’m new to Algorand and i’m having some difficulties on Boxes and Arrays. I need to store an array into a box and, when asked, to add an element to that array. The array element type is a custom class i created.  
The main problem is that i can’t find a way to add the element once i retrieve the array from the box

---

<div class="post-metadata">

**Author:** ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)\
**Post date:** [May 31, 2023, 12:56pm UTC](https://forum.algorand.co/t/dynamicarray-add-element/9702/2 "2023-05-31T12:56:49Z")

</div>

Can you show the `Array` custom class you used?

---

<div class="post-metadata">

**Author:** ![MatBarons](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@MatBarons](https://forum.algorand.co/u/MatBarons)\
**Post date:** [May 31, 2023, 2:35pm UTC](https://forum.algorand.co/t/dynamicarray-add-element/9702/3 "2023-05-31T14:35:48Z")

</div>

The array type isn’t custom, i used DynamicArray. However the elements in the array are custom type. The problem is that i can’t find a way to add an element to the array, even if the element type is a base type.  
For example, there is not .add() method and the .set() method doesn’t work that way
