# Post Looping through an Array not working

**URL:** <https://community.postman.com/t/post-looping-through-an-array-not-working/40758>\
**Category:** Help Hub\
**Created:** [November 3, 2022, 6:38pm UTC](https://community.postman.com/t/post-looping-through-an-array-not-working/40758 "2022-11-03T18:38:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [November 4, 2022, 4:10pm UTC](https://community.postman.com/t/post-looping-through-an-array-not-working/40758/3 "2022-11-04T16:10:21Z")

</div>

I can’t see a loop here. I can see a couple of IF statements.

What do you mean by the “run” process. Is this set to loop?

Do you mean the shift line which should just remove and return the first element of the array.

Have a look at this link which has an example of a for and forEach loop if that is what you need.

> [@Run the same test through all arrays objects](https://community.postman.com/t/run-the-same-test-through-all-arrays-objects/40782):
>
> Hey! Is there a way to run the same test script through all array objects? I have that pm.test that i want to run through all array objects, that in that case is 82, but it might be more or it might be less. Is there a way to this? Thanks a bunch!

---

_[View the full topic](https://community.postman.com/t/post-looping-through-an-array-not-working/40758)._
