# Get output for each item from a list of items

**URL:** <https://community.postman.com/t/get-output-for-each-item-from-a-list-of-items/55984>\
**Category:** Help Hub\
**Tags:** tests, variables, collections\
**Created:** [December 27, 2023, 4:45am UTC](https://community.postman.com/t/get-output-for-each-item-from-a-list-of-items/55984 "2023-12-27T04:45:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [December 27, 2023, 8:40am UTC](https://community.postman.com/t/get-output-for-each-item-from-a-list-of-items/55984/2 "2023-12-27T08:40:37Z")

</div>

Hey @anchalsingh12 👋

Welcome to the Postman community! :postman:

This recent thread might give you some scripting inspiration, sound like you’re getting into the same issue with selecting the first item each time.

> [@collectionVariables returns value by reference or by value](https://community.postman.com/t/collectionvariables-returns-value-by-reference-or-by-value/55592):
>
> Hi community people, I am trying to simulate a collection which has 2 request Get ProductId’s Post Request: Place Orders using productId’s returned from 1st response [image] I stored all productId’s from response1 in an array in a local variable and later set variables in 2 scopes as below Case1: pm.variables.set Case2: pm.collectionVariables.set in each case, I am trying to get one productId from the given array and Place Order Array automatically updated if I make…

---

_[View the full topic](https://community.postman.com/t/get-output-for-each-item-from-a-list-of-items/55984)._
