# Pass multiple inputs from an array using Prescript

**URL:** <https://community.postman.com/t/pass-multiple-inputs-from-an-array-using-prescript/54812>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [November 20, 2023, 2:03pm UTC](https://community.postman.com/t/pass-multiple-inputs-from-an-array-using-prescript/54812 "2023-11-20T14:03:18Z")\
**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:** [November 20, 2023, 3:36pm UTC](https://community.postman.com/t/pass-multiple-inputs-from-an-array-using-prescript/54812/2 "2023-11-20T15:36:27Z")

</div>

Hey @ramofficial1 👋

Is there anything you can get from this topic and the thread?

It seems like the same code being used. There are other similar questions in the community with the same code too.

> [@There was an error in evaluating the Pre-request Script: TypeError: Cannot read property 'shift' of undefined](https://community.postman.com/t/there-was-an-error-in-evaluating-the-pre-request-script-typeerror-cannot-read-property-shift-of-undefined/18094/13):
>
> Ok your last message was telling of what was wrong. Your prerequest script in fact is resetting the array every time. Pre-request script: var buyerProgramId= [‘1961’, ‘1962’, ‘1972’, ‘1976’, ‘1977’]; pm.globals.set(“buyerProgramId”, JSON.stringify(buyerProgramId)); This is where you want to do your array manipulation. You should be popping the array and saving the new contents here. let buyerProgramId = pm.globals.get('buyerProgramId'); if(!buyerProgramId){ buyerProgramId= ['1961', '1962'…

or maybe this other topic:

> [@Loop through values from GET to next PUT request](https://community.postman.com/t/loop-through-values-from-get-to-next-put-request/41899/11):
>
> Here is some example code. I’m using Postman Echo with a POST request to emulate your response, with the loop being a GET request with the filesystem being echoed back as a parameter. [image] This is the body I’m working with. { "filesystems": [ { "name": "fs1", "root\_permissions": "775", "mountpoint": "/{{ old path }}/fs1" }, { "name": "fs2", "root\_permissions": "775", "mountpoint": "/{{ old path }}/…

---

_[View the full topic](https://community.postman.com/t/pass-multiple-inputs-from-an-array-using-prescript/54812)._
