# \#array

**URL:** https://community.postman.com/tag/array/133.md

[Latest](https://community.postman.com/latest.md) · [Categories](https://community.postman.com/categories.md) · [Tags](https://community.postman.com/tags.md)

---

## [Writing runner payloads dynamically to an array?](https://community.postman.com/t/writing-runner-payloads-dynamically-to-an-array/83509)

<div class="topic-metadata">

**Author:** [@jmichaudjss](https://community.postman.com/u/jmichaudjss)\
**Replies:** 1\
**Last updated:** [August 12, 2025, 5:22pm UTC](https://community.postman.com/t/writing-runner-payloads-dynamically-to-an-array/83509 "2025-08-12T17:22:15Z")

</div>

Hello, quick question: Can I programmatically loop over data in a JSON file, taking iteration data for the first X number of entries, and combine them into a single request? Scenario: Say I have 100 JSON objects to sen…

---

## [Joining strings with arrays and objects in javascript](https://community.postman.com/t/joining-strings-with-arrays-and-objects-in-javascript/80611)

<div class="topic-metadata">

**Author:** [@supply-saganist-2835](https://community.postman.com/u/supply-saganist-2835)\
**Replies:** 2\
**Last updated:** [May 30, 2025, 10:18am UTC](https://community.postman.com/t/joining-strings-with-arrays-and-objects-in-javascript/80611 "2025-05-30T10:18:33Z")

</div>

Hello I need help with this coding problem I have to do is Sentences: "the quick brown fox " "jumps over the lazy dog " NOTE 1: Spaces have been provided for you so you simply have to use the + operator to join toget…

---

## [How to include multiple keys and values in csv cells for collection runner](https://community.postman.com/t/how-to-include-multiple-keys-and-values-in-csv-cells-for-collection-runner/35077)

<div class="topic-metadata">

**Author:** [@user1995](https://community.postman.com/u/user1995)\
**Replies:** 0\
**Last updated:** [May 6, 2022, 10:07am UTC](https://community.postman.com/t/how-to-include-multiple-keys-and-values-in-csv-cells-for-collection-runner/35077 "2022-05-06T10:07:45Z")

</div>

How to include a multiple keys with values which is an array inside the CSV cell to be then passed into Collection Runner? Existing body: { "diagTransactionId": "{{diagTransactionId}}", "vin": "{{vin}}", …

---

## [Comparing array values](https://community.postman.com/t/comparing-array-values/75217)

<div class="topic-metadata">

**Author:** [@ruma204](https://community.postman.com/u/ruma204)\
**Replies:** 1\
**Last updated:** [February 10, 2025, 6:50pm UTC](https://community.postman.com/t/comparing-array-values/75217 "2025-02-10T18:50:56Z")

</div>

I am verifying if my values match with JSON response. Here is my code - pm.test("Status test", function () { pm.response.to.have.status(200); }); pm.test("Testing Related Products", function () { let respon…

---

## [How to sort array in postman?](https://community.postman.com/t/how-to-sort-array-in-postman/7762)

<div class="topic-metadata">

**Author:** [@e.mikhailov](https://community.postman.com/u/e.mikhailov)\
**Replies:** 8\
**Last updated:** [January 3, 2025, 7:31pm UTC](https://community.postman.com/t/how-to-sort-array-in-postman/7762 "2025-01-03T19:31:31Z")

</div>

By the way, I have two questions about my code - how to sort an array in Postman and if there is a better way to compare objects except mine. I use this block to compare properties to check equality of JSON objects body1…

---

## [Retrieve string value in array from an response](https://community.postman.com/t/retrieve-string-value-in-array-from-an-response/61301)

<div class="topic-metadata">

**Author:** [@anita.christobel](https://community.postman.com/u/anita.christobel)\
**Replies:** 2\
**Last updated:** [May 22, 2024, 2:57pm UTC](https://community.postman.com/t/retrieve-string-value-in-array-from-an-response/61301 "2024-05-22T14:57:09Z")

</div>

Below is the response for my request { "code": 401, "reason": "Unauthorized", "detail": { "failureUrl": "{\\"code\\":403,\\"reason\\":\\"Forbidden\\",\\"message\\":\\"Policy validation failed\\",\\"detail\\":{\\"result\\":f…

---

## [I can't get the sixth element from the header array](https://community.postman.com/t/i-cant-get-the-sixth-element-from-the-header-array/59937)

<div class="topic-metadata">

**Author:** [@garibzyanovsergei](https://community.postman.com/u/garibzyanovsergei)\
**Replies:** 4\
**Last updated:** [April 15, 2024, 5:16pm UTC](https://community.postman.com/t/i-cant-get-the-sixth-element-from-the-header-array/59937 "2024-04-15T17:16:55Z")

</div>

Why I can’t get the sixth element from the header array from the response, because it’s there? I have the code in the pre-request scripts: pm.sendRequest({ url: pm.environment.get('baseUrl') + '/checkPhone', …

---

## [POST - Headers - multidimensional array](https://community.postman.com/t/post-headers-multidimensional-array/58224)

<div class="topic-metadata">

**Author:** [@lunar-module-observe](https://community.postman.com/u/lunar-module-observe)\
**Replies:** 2\
**Last updated:** [February 29, 2024, 10:38am UTC](https://community.postman.com/t/post-headers-multidimensional-array/58224 "2024-02-29T10:38:13Z")

</div>

I trying to add multidimensional array into headers of a POST call. Searching for answers showed me I should use square brackets, some suggested with a period some without, but it seems like the square brackets is no…

---

## [Array is returned as comma separated string instead of array](https://community.postman.com/t/array-is-returned-as-comma-separated-string-instead-of-array/56747)

<div class="topic-metadata">

**Author:** [@tonatiuhromero](https://community.postman.com/u/tonatiuhromero)\
**Replies:** 2\
**Last updated:** [February 2, 2024, 3:03pm UTC](https://community.postman.com/t/array-is-returned-as-comma-separated-string-instead-of-array/56747 "2024-02-02T15:03:36Z")

</div>

I am trying to create request with a Pre-request script where I have an array. Then I am trying to use that array in a request. When I use the variable reference I get the array as a comma separated string of the element…

---

## [Loop through two arrays](https://community.postman.com/t/loop-through-two-arrays/54041)

<div class="topic-metadata">

**Author:** [@bartlomiejczech](https://community.postman.com/u/bartlomiejczech)\
**Replies:** 1\
**Last updated:** [October 29, 2023, 3:20pm UTC](https://community.postman.com/t/loop-through-two-arrays/54041 "2023-10-29T15:20:09Z")

</div>

Hi, im new in Postman. I have two arrays for example var a = \[“x”,“Y”\] and var b = \[“1”,“2”\] i’d like to send request for each combiination something like for loop in for loop. I can send requests with one array but i ca…

---

## [Checking fields in an array using a for loop](https://community.postman.com/t/checking-fields-in-an-array-using-a-for-loop/52847)

<div class="topic-metadata">

**Author:** [@satellite-geologis10](https://community.postman.com/u/satellite-geologis10)\
**Replies:** 4\
**Last updated:** [October 7, 2023, 6:19pm UTC](https://community.postman.com/t/checking-fields-in-an-array-using-a-for-loop/52847 "2023-10-07T18:19:09Z")

</div>

I want to check if certain fields are in the response body. I tried to use a for loop and an array with the names of these fields. This is my test code: const jsonData = pm.response.json(); const responce\_required = \[ …

---

## [Array in requestBody duplicates array indexes](https://community.postman.com/t/array-in-requestbody-duplicates-array-indexes/51019)

<div class="topic-metadata">

**Author:** [@rjs](https://community.postman.com/u/rjs)\
**Replies:** 0\
**Last updated:** [August 27, 2023, 2:25pm UTC](https://community.postman.com/t/array-in-requestbody-duplicates-array-indexes/51019 "2023-08-27T14:25:54Z")

</div>

Hi all, After creating a new API in PM (see JSON code) and Add Collection → Generate from definition the requestBody duplicates the proparray indexes and deleted array is not printed. When importing same file to Swagge…

---

## [Send Array Index Value in JSON Request Body for Batch Operation using Runner](https://community.postman.com/t/send-array-index-value-in-json-request-body-for-batch-operation-using-runner/48857)

<div class="topic-metadata">

**Author:** [@0sanjary](https://community.postman.com/u/0sanjary)\
**Replies:** 3\
**Last updated:** [June 23, 2023, 9:37am UTC](https://community.postman.com/t/send-array-index-value-in-json-request-body-for-batch-operation-using-runner/48857 "2023-06-23T09:37:28Z")

</div>

Here’s my problem scenario: I have an array of 10K user\_id. I need to send them in Request Body using Collection Runner. I need to send 100 user\_ids in one request and I will loop through the request 100 times using Col…

---

## [Compare two arrays & save the mismatched data in an array](https://community.postman.com/t/compare-two-arrays-save-the-mismatched-data-in-an-array/40780)

<div class="topic-metadata">

**Author:** [@aksh-s-rathod](https://community.postman.com/u/aksh-s-rathod)\
**Replies:** 1\
**Last updated:** [November 4, 2022, 5:13pm UTC](https://community.postman.com/t/compare-two-arrays-save-the-mismatched-data-in-an-array/40780 "2022-11-04T17:13:27Z")

</div>

I need to compare two arrays & get the mismatched data from both into third array. Details: following is the code I used for reference var array1 = \[1, 2, 3, 4, 8, 5, 6, 7\]; var array2 = \[6, 5, 4, 3, 2, 1\] ; var array3…

---

## [How to extract a value from response array and store in an environment variable](https://community.postman.com/t/how-to-extract-a-value-from-response-array-and-store-in-an-environment-variable/38695)

<div class="topic-metadata">

**Author:** [@oneappuser](https://community.postman.com/u/oneappuser)\
**Replies:** 9\
**Last updated:** [September 1, 2022, 3:53pm UTC](https://community.postman.com/t/how-to-extract-a-value-from-response-array-and-store-in-an-environment-variable/38695 "2022-09-01T15:53:17Z")

</div>

Hello All, Below is the response I am getting from my API. I wan the priority and offering id value to be stored in an env variable from this response. Please help on this. \[ { “id”: “49fcd-180f-432323-99dc-b370a32…

---

## [AssertionError to check keys in json](https://community.postman.com/t/assertionerror-to-check-keys-in-json/37921)

<div class="topic-metadata">

**Author:** [@science-pilot-863855](https://community.postman.com/u/science-pilot-863855)\
**Replies:** 5\
**Last updated:** [August 17, 2022, 8:33am UTC](https://community.postman.com/t/assertionerror-to-check-keys-in-json/37921 "2022-08-17T08:33:51Z")

</div>

I have an API Endpoint that returns a JSON array in response: \[ { "base": "ethereum-eth", "quote": "tether-usdt", "volume": 60126390.25608005, "price": 1663.0597462528697, "vo…

---

## [Pm code checking array for undefined element](https://community.postman.com/t/pm-code-checking-array-for-undefined-element/36315)

<div class="topic-metadata">

**Author:** [@ksully](https://community.postman.com/u/ksully)\
**Replies:** 8\
**Last updated:** [June 20, 2022, 6:22pm UTC](https://community.postman.com/t/pm-code-checking-array-for-undefined-element/36315 "2022-06-20T18:22:17Z")

</div>

GET response brings back a certain number of elements. Have an array, sized with expected number of elements anticipated. So we walk through the GET response (for-loop), checking each element in the GET response for sp…

---

## [Iterating through array until item.x is found, then assign item.y as variable](https://community.postman.com/t/iterating-through-array-until-item-x-is-found-then-assign-item-y-as-variable/36299)

<div class="topic-metadata">

**Author:** [@sgoorkate](https://community.postman.com/u/sgoorkate)\
**Replies:** 0\
**Last updated:** [June 17, 2022, 9:04am UTC](https://community.postman.com/t/iterating-through-array-until-item-x-is-found-then-assign-item-y-as-variable/36299 "2022-06-17T09:04:15Z")

</div>

Hello. I’m trying to write a test that checks if the response of a GET, an array, contains a certain value (a string). The value that it should be looking for comes from a CSV file, because the request is part of a colle…

---

## [Check for a specific array in response body?](https://community.postman.com/t/check-for-a-specific-array-in-response-body/35697)

<div class="topic-metadata">

**Author:** [@artradz.v](https://community.postman.com/u/artradz.v)\
**Replies:** 1\
**Last updated:** [June 10, 2022, 7:21pm UTC](https://community.postman.com/t/check-for-a-specific-array-in-response-body/35697 "2022-06-10T19:21:28Z")

</div>

I’m getting a response that has 2 arrays in it. Example: { “hobbies”: \[ “skating”, “painting” \], “books”: \[ “book1”, “book2” \] } How to check that response doesn’t have array with the name “books”? Thank you. …

---

## [How can I post array object from Posman to Google Sheets](https://community.postman.com/t/how-can-i-post-array-object-from-posman-to-google-sheets/34687)

<div class="topic-metadata">

**Author:** [@dyshek](https://community.postman.com/u/dyshek)\
**Replies:** 0\
**Last updated:** [April 22, 2022, 10:01am UTC](https://community.postman.com/t/how-can-i-post-array-object-from-posman-to-google-sheets/34687 "2022-04-22T10:01:38Z")

</div>

Hello I’m new to postman and coding. I am trying to post array object from Postman to google sheets. This way I can send a single object. { "OwnerSerno": 79930, "OwnerType": 2, "InConsumption": \[ …

---

## [How to find the last object in the array](https://community.postman.com/t/how-to-find-the-last-object-in-the-array/32504)

<div class="topic-metadata">

**Author:** [@aieshachayka](https://community.postman.com/u/aieshachayka)\
**Replies:** 2\
**Last updated:** [February 18, 2022, 3:12pm UTC](https://community.postman.com/t/how-to-find-the-last-object-in-the-array/32504 "2022-02-18T15:12:04Z")

</div>

Hi! In the below example I have API that will return list of sections, each section can contain some amount of Shows. First section title will be always “All Upcoming Shows”, and last section will always be “All Replay …

---

## [Parsing json array variable into body request results in NULL](https://community.postman.com/t/parsing-json-array-variable-into-body-request-results-in-null/28646)

<div class="topic-metadata">

**Author:** [@kverreth](https://community.postman.com/u/kverreth)\
**Replies:** 1\
**Last updated:** [October 13, 2021, 4:43pm UTC](https://community.postman.com/t/parsing-json-array-variable-into-body-request-results-in-null/28646 "2021-10-13T16:43:46Z")

</div>

In postman flow i created a chain where I assign variables from my GET request in order to use them in my next POST request A sample of the POST body request: { "metadata": { "configurationVersions": \[ …

---

## [How to get an array of a nested JSON response](https://community.postman.com/t/how-to-get-an-array-of-a-nested-json-response/28008)

<div class="topic-metadata">

**Author:** [@felipe.pazinatto](https://community.postman.com/u/felipe.pazinatto)\
**Replies:** 2\
**Last updated:** [September 21, 2021, 3:01pm UTC](https://community.postman.com/t/how-to-get-an-array-of-a-nested-json-response/28008 "2021-09-21T15:01:13Z")

</div>

Hey community! I have the following payload that I\`m receiving as a response: { "Messages": \[ { "CreationDate": "2021-09-20T16:09:55.683", "Code": "100", "Description": "…

---

## [How to add more objects into an array](https://community.postman.com/t/how-to-add-more-objects-into-an-array/26794)

<div class="topic-metadata">

**Author:** [@x9stuido](https://community.postman.com/u/x9stuido)\
**Replies:** 3\
**Last updated:** [August 18, 2021, 4:55pm UTC](https://community.postman.com/t/how-to-add-more-objects-into-an-array/26794 "2021-08-18T16:55:43Z")

</div>

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic. Here’s an outline with best practices for making your…

---

## [An assertion to check whether the array in the response body match with a JSON file](https://community.postman.com/t/an-assertion-to-check-whether-the-array-in-the-response-body-match-with-a-json-file/26603)

<div class="topic-metadata">

**Author:** [@docking-module-geos3](https://community.postman.com/u/docking-module-geos3)\
**Replies:** 1\
**Last updated:** [August 11, 2021, 10:18am UTC](https://community.postman.com/t/an-assertion-to-check-whether-the-array-in-the-response-body-match-with-a-json-file/26603 "2021-08-11T10:18:40Z")

</div>

Hi, I want to add an assertion to check whether the array in the response body match with a JSON file In the below example, I have an array “ErrorCode” with 3 elements (in reality, there are a lot of returned data so I…

---

## [Get the latest record from an array response without root](https://community.postman.com/t/get-the-latest-record-from-an-array-response-without-root/25974)

<div class="topic-metadata">

**Author:** [@aviation-meteorologi](https://community.postman.com/u/aviation-meteorologi)\
**Replies:** 3\
**Last updated:** [July 29, 2021, 7:03am UTC](https://community.postman.com/t/get-the-latest-record-from-an-array-response-without-root/25974 "2021-07-29T07:03:41Z")

</div>

I want to get the user\_recipient\_id of the last node from the responseBody array. This is dynamic, a new node from the last node will be added for new data in responseBody. Sample responseBody: \[ { "nickna…

---

## [Assertions for API Test scripts](https://community.postman.com/t/assertions-for-api-test-scripts/8717)

<div class="topic-metadata">

**Author:** [@gayaniw](https://community.postman.com/u/gayaniw)\
**Replies:** 1\
**Last updated:** [July 22, 2021, 6:25pm UTC](https://community.postman.com/t/assertions-for-api-test-scripts/8717 "2021-07-22T18:25:54Z")

</div>

API Assertions API testing is all about assertions. There are two steps to write assertions Parse the response body Write the test Response body may come as a JSON, XML,HTML, Plain text or CSV. But the common format …

---

## [To assert that the array in the response body contains a string value in all its elements](https://community.postman.com/t/to-assert-that-the-array-in-the-response-body-contains-a-string-value-in-all-its-elements/10017)

<div class="topic-metadata">

**Author:** [@LearningPostmanR](https://community.postman.com/u/LearningPostmanR)\
**Replies:** 30\
**Last updated:** [June 24, 2021, 11:40am UTC](https://community.postman.com/t/to-assert-that-the-array-in-the-response-body-contains-a-string-value-in-all-its-elements/10017 "2021-06-24T11:40:12Z")

</div>

Hi, New to Postman and not accustomed to writing code so please help. Couldn’t find any similar post either which I could use. I want to add an assertion to check whether a value is present in all the elements in an ar…

---

## [Retrieve parts of a GET response to feed into the next PATCH update body after some formatting](https://community.postman.com/t/retrieve-parts-of-a-get-response-to-feed-into-the-next-patch-update-body-after-some-formatting/23826)

<div class="topic-metadata">

**Author:** [@balexalex](https://community.postman.com/u/balexalex)\
**Replies:** 2\
**Last updated:** [May 17, 2021, 8:29pm UTC](https://community.postman.com/t/retrieve-parts-of-a-get-response-to-feed-into-the-next-patch-update-body-after-some-formatting/23826 "2021-05-17T20:29:40Z")

</div>

Hello, I am newbie. I’m using a GET to request a list of objects. These are just a few of them in the response: { “id”: 437725467, “name”: “Div - 02”, “orig\_id”: null, “proj\_id”: “12345”, “code”: “02” }, { “id…

---

## [Expect the value of a property to be an array with content of type string or an empty array](https://community.postman.com/t/expect-the-value-of-a-property-to-be-an-array-with-content-of-type-string-or-an-empty-array/23723)

<div class="topic-metadata">

**Author:** [@bezzea](https://community.postman.com/u/bezzea)\
**Replies:** 1\
**Last updated:** [May 13, 2021, 9:52pm UTC](https://community.postman.com/t/expect-the-value-of-a-property-to-be-an-array-with-content-of-type-string-or-an-empty-array/23723 "2021-05-13T21:52:28Z")

</div>

I would like to know how to structure the following response body into a jsonschema. { "iAmThePropOfAnObject":\[\] } { "iAmThePropOfAnObject":\[ "this would be string in some cases", "this woul…

[Next page](https://community.postman.com/tag/array/133.md?match_all_tags=true&page=1&tags%5B%5D=array)
