# \#javascript

**URL:** https://community.postman.com/tag/javascript/276.md

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

---

## [The Postman Drop: May Edition - Cutting Through JavaScript, Governance, and Agent Bottlenecks](https://community.postman.com/t/the-postman-drop-may-edition-cutting-through-javascript-governance-and-agent-bottlenecks/80235)

<div class="topic-metadata">

**Author:** [@postman-drop](https://community.postman.com/u/postman-drop)\
**Replies:** 2\
**Last updated:** [June 2, 2025, 11:11pm UTC](https://community.postman.com/t/the-postman-drop-may-edition-cutting-through-javascript-governance-and-agent-bottlenecks/80235 "2025-06-02T23:11:25Z")

</div>

In this Drop, we’re sharing solutions to streamline your development workflows, including: Support for external public packages means no wasting time or risking errors by copy/pasting JavaScript libraries Custom valida…

---

## [\<script\> tags in templates for Tests script not working](https://community.postman.com/t/script-tags-in-templates-for-tests-script-not-working/29006)

<div class="topic-metadata">

**Author:** [@prasannaKul](https://community.postman.com/u/prasannaKul)\
**Replies:** 0\
**Last updated:** [October 22, 2021, 10:19am UTC](https://community.postman.com/t/script-tags-in-templates-for-tests-script-not-working/29006 "2021-10-22T10:19:29Z")

</div>

Hi all, I am trying to create a very simple Tests script, which can display response text. Here my \<span\> tag works fine, but I don’t get the console log in \<script\> tag. The console log outside the template works fine,…

---

## [From postman json to javascript fetch](https://community.postman.com/t/from-postman-json-to-javascript-fetch/77264)

<div class="topic-metadata">

**Author:** [@iosifziman](https://community.postman.com/u/iosifziman)\
**Replies:** 1\
**Last updated:** [March 19, 2025, 8:27am UTC](https://community.postman.com/t/from-postman-json-to-javascript-fetch/77264 "2025-03-19T08:27:21Z")

</div>

I have a postman API call working and exported the json from it. Anyone has some advice how to use the json i exported or the format that works in postman to build a working fetch in javascript? in js I keep getting an …

---

## [Rotate Adobe Experience Platform API via Postman](https://community.postman.com/t/rotate-adobe-experience-platform-api-via-postman/76652)

<div class="topic-metadata">

**Author:** [@telecoms-candidate11](https://community.postman.com/u/telecoms-candidate11)\
**Replies:** 7\
**Last updated:** [March 12, 2025, 11:50am UTC](https://community.postman.com/t/rotate-adobe-experience-platform-api-via-postman/76652 "2025-03-12T11:50:20Z")

</div>

Adobe Experience Platform (AEP) uses OAuth 2.0 authentication, requiring a new access token every 60 minutes. How to keep API calls running smoothly, in automate token rotation in Postman. How to use JavaScript in Postm…

---

## [Receiving "Since your browser does not support support javascript..." upon trying to get request](https://community.postman.com/t/receiving-since-your-browser-does-not-support-support-javascript-upon-trying-to-get-request/42804)

<div class="topic-metadata">

**Author:** [@e358875](https://community.postman.com/u/e358875)\
**Replies:** 3\
**Last updated:** [January 17, 2025, 5:43pm UTC](https://community.postman.com/t/receiving-since-your-browser-does-not-support-support-javascript-upon-trying-to-get-request/42804 "2025-01-17T17:43:56Z")

</div>

I am attempting to perform API testing and I am using postman to call an endpoint (GET) and it is resulting in Status of 200 and following Note/Error: Note: Since your browser does not support JavaScript, you must press…

---

## [Postman 404 not found app.js:30:8](https://community.postman.com/t/postman-404-not-found-app-js8/72090)

<div class="topic-metadata">

**Author:** [@azadarkan](https://community.postman.com/u/azadarkan)\
**Replies:** 0\
**Last updated:** [December 4, 2024, 9:57pm UTC](https://community.postman.com/t/postman-404-not-found-app-js8/72090 "2024-12-04T21:57:19Z")

</div>

I run a POST request in POSTMAN ({{URL}}/api/roles/add) and get a 404 error. How do you fix not found error? app.js if (process.env.NODE\_ENV != "production") require("dotenv").config(); var createError = require("http…

---

## [Payload Variable Iteration](https://community.postman.com/t/payload-variable-iteration/70140)

<div class="topic-metadata">

**Author:** [@daiva001](https://community.postman.com/u/daiva001)\
**Replies:** 2\
**Last updated:** [October 24, 2024, 11:32am UTC](https://community.postman.com/t/payload-variable-iteration/70140 "2024-10-24T11:32:40Z")

</div>

Hello community, I have a Payload of 100 variables. i can’t change them manually where i need to do a mandatory check for each feild like 100 times. can i do the payload as centralised and run some iteration where ea…

---

## [Save endpoint variable through collection function](https://community.postman.com/t/save-endpoint-variable-through-collection-function/64806)

<div class="topic-metadata">

**Author:** [@joint-operations-ob5](https://community.postman.com/u/joint-operations-ob5)\
**Replies:** 2\
**Last updated:** [July 31, 2024, 11:41am UTC](https://community.postman.com/t/save-endpoint-variable-through-collection-function/64806 "2024-07-31T11:41:25Z")

</div>

Intro: Hi there, I’m on a beginner level of javascript/postman-scripts and trying to figure some stuff out myself to obtain knowledge in this area. I’m using an existing API to figure things out. My goal: I want to use …

---

## [How can I test nested properties using JSON test data?](https://community.postman.com/t/how-can-i-test-nested-properties-using-json-test-data/61774)

<div class="topic-metadata">

**Author:** [@wilq8484](https://community.postman.com/u/wilq8484)\
**Replies:** 27\
**Last updated:** [June 6, 2024, 12:55pm UTC](https://community.postman.com/t/how-can-i-test-nested-properties-using-json-test-data/61774 "2024-06-06T12:55:46Z")

</div>

I have some property to test in JSON response using test data of JSON file. How can I validate that data from JSON test data file (only one value and iteration ‘title’) matches property under items. I would like to acc…

---

## [Xml2js tag name has a hyphen in name](https://community.postman.com/t/xml2js-tag-name-has-a-hyphen-in-name/58577)

<div class="topic-metadata">

**Author:** [@kubczi](https://community.postman.com/u/kubczi)\
**Replies:** 5\
**Last updated:** [March 7, 2024, 11:35am UTC](https://community.postman.com/t/xml2js-tag-name-has-a-hyphen-in-name/58577 "2024-03-07T11:35:10Z")

</div>

I want to read specific tag from xml body but there is a tag and there is an error: TypeError: Cannot read properties of undefined (reading ‘hip’) I belive the reason is that it has ‘-’ in the name. I tried something …

---

## [Code Snippet Generator - .then vs async/await](https://community.postman.com/t/code-snippet-generator-then-vs-async-await/56714)

<div class="topic-metadata">

**Author:** [@docking-module-admi2](https://community.postman.com/u/docking-module-admi2)\
**Replies:** 2\
**Last updated:** [January 18, 2024, 8:56pm UTC](https://community.postman.com/t/code-snippet-generator-then-vs-async-await/56714 "2024-01-18T20:56:41Z")

</div>

Postman code usually provide JavaScript fetch code in .then syntax. Is there a way to make async/await syntax default?

---

## [Python requests to Javascript fetch?](https://community.postman.com/t/python-requests-to-javascript-fetch/55511)

<div class="topic-metadata">

**Author:** [@sashimikid](https://community.postman.com/u/sashimikid)\
**Replies:** 1\
**Last updated:** [December 11, 2023, 11:12am UTC](https://community.postman.com/t/python-requests-to-javascript-fetch/55511 "2023-12-11T11:12:34Z")

</div>

I’m trying to translate this working Python 3.x code, that uses Python’s “requests” library, into Javascript ES6 code that uses 'fetch", but I cannot seem to replicate the request using Javascript. The problem seems to…

---

## [Check if array contains 'true' or 'false' flag in Response](https://community.postman.com/t/check-if-array-contains-true-or-false-flag-in-response/48552)

<div class="topic-metadata">

**Author:** [@gonsag](https://community.postman.com/u/gonsag)\
**Replies:** 6\
**Last updated:** [June 19, 2023, 10:32pm UTC](https://community.postman.com/t/check-if-array-contains-true-or-false-flag-in-response/48552 "2023-06-19T22:32:29Z")

</div>

Hi team, I have an array which contains the flag as : \[false, true, false\] and so on. I wrote code to fetch out using contains, include, have.property and others as an ‘if’ condition and unable to trigger the condition …

---

## [Set environment variables from Visualizer?](https://community.postman.com/t/set-environment-variables-from-visualizer/47403)

<div class="topic-metadata">

**Author:** [@joncamp1911](https://community.postman.com/u/joncamp1911)\
**Replies:** 2\
**Last updated:** [May 15, 2023, 5:01pm UTC](https://community.postman.com/t/set-environment-variables-from-visualizer/47403 "2023-05-15T17:01:03Z")

</div>

I am using the visualizer to gather a list of objects from a web service, each with a guid id. For subsequent calls to other requests I need to use that id. Currently I am copy/pasting the id into an environment variable…

---

## [Some interesting Math functions for API Testing!](https://community.postman.com/t/some-interesting-math-functions-for-api-testing/18846)

<div class="topic-metadata">

**Author:** [@bpricilla](https://community.postman.com/u/bpricilla)\
**Replies:** 5\
**Last updated:** [January 12, 2023, 11:18am UTC](https://community.postman.com/t/some-interesting-math-functions-for-api-testing/18846 "2023-01-12T11:18:25Z")

</div>

Dear Community!! Though 2020 was not a good year for most of us, somehow its over by now. I wish everyone a cheerful and healthy 2021!! While writing some tests for API, I found some JS Math functions are quite useful…

---

## [Fetching values of a single key repeating multiple times](https://community.postman.com/t/fetching-values-of-a-single-key-repeating-multiple-times/42765)

<div class="topic-metadata">

**Author:** [@gonsag](https://community.postman.com/u/gonsag)\
**Replies:** 3\
**Last updated:** [January 12, 2023, 9:24am UTC](https://community.postman.com/t/fetching-values-of-a-single-key-repeating-multiple-times/42765 "2023-01-12T09:24:57Z")

</div>

Here’s an outline with best practices for making your inquiry. My question: Is there a way to fetch the values of a single key which is having multiple instances throughout the json object response? Would it be possi…

---

## [Postman-CLI crash - JavaScript heap out of memory](https://community.postman.com/t/postman-cli-crash-javascript-heap-out-of-memory/40319)

<div class="topic-metadata">

**Author:** [@douglasmccormickjr](https://community.postman.com/u/douglasmccormickjr)\
**Replies:** 1\
**Last updated:** [October 31, 2022, 8:08pm UTC](https://community.postman.com/t/postman-cli-crash-javascript-heap-out-of-memory/40319 "2022-10-31T20:08:05Z")

</div>

My question: I’ve installed and am using the Postman-CLI on my windows machine. It crashed when it got to my 2 of 3 iteration. I’m getting this message: FATAL ERROR: Reached heap limit Allocation failed - JavaScript h…

---

## [Using AJv to validate Json schema](https://community.postman.com/t/using-ajv-to-validate-json-schema/38309)

<div class="topic-metadata">

**Author:** [@phuongphuong99](https://community.postman.com/u/phuongphuong99)\
**Replies:** 2\
**Last updated:** [September 4, 2022, 12:04pm UTC](https://community.postman.com/t/using-ajv-to-validate-json-schema/38309 "2022-09-04T12:04:27Z")

</div>

Hello everyone, i’m having a trouble when i use ajv to validate Json schema. This is my test script: const expectSchema = { “definitions”: { “Welcome”: { “type”: “object”, “additionalProperties”: false, “properties…

---

## [Html table show in javascript please help me](https://community.postman.com/t/html-table-show-in-javascript-please-help-me/36716)

<div class="topic-metadata">

**Author:** [@Aezaz](https://community.postman.com/u/Aezaz)\
**Replies:** 1\
**Last updated:** [June 30, 2022, 2:38pm UTC](https://community.postman.com/t/html-table-show-in-javascript-please-help-me/36716 "2022-06-30T14:38:15Z")

</div>

I need to show table with data in alert dialog. how to ?

---

## [Postman Pre-Request Script to Read Variables from CSV file and Append to JSON Body](https://community.postman.com/t/postman-pre-request-script-to-read-variables-from-csv-file-and-append-to-json-body/36603)

<div class="topic-metadata">

**Author:** [@evidence8321](https://community.postman.com/u/evidence8321)\
**Replies:** 6\
**Last updated:** [June 28, 2022, 12:46am UTC](https://community.postman.com/t/postman-pre-request-script-to-read-variables-from-csv-file-and-append-to-json-body/36603 "2022-06-28T00:46:06Z")

</div>

I have a JSON body with template to pass to an API endpoint in Postman/Newman as follows: { "total": \[ { "var1a": "ABCDE", "var1b": { "var2a": "http://url/site/{{yyyy}}/{{mmdd}}/{{yyyymmdd}}.zi…

---

## [Postman.setNextrequest method doesn’t work in postman](https://community.postman.com/t/postman-setnextrequest-method-doesn-t-work-in-postman/35401)

<div class="topic-metadata">

**Author:** [@vivekak](https://community.postman.com/u/vivekak)\
**Replies:** 1\
**Last updated:** [June 15, 2022, 6:58pm UTC](https://community.postman.com/t/postman-setnextrequest-method-doesn-t-work-in-postman/35401 "2022-06-15T18:58:18Z")

</div>

Postman.setNextrequest doesn’t work. I tried with multiple ways, but still not working My requirement to run a new endpoint after the loop pm.test("Get code of each countries", function () { var jsonData = pm.response.…

---

## [Javascript test failures](https://community.postman.com/t/javascript-test-failures/32767)

<div class="topic-metadata">

**Author:** [@mapho00](https://community.postman.com/u/mapho00)\
**Replies:** 1\
**Last updated:** [February 24, 2022, 10:03am UTC](https://community.postman.com/t/javascript-test-failures/32767 "2022-02-24T10:03:49Z")

</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…

---

## [How to wait for an async pm.sendRequest to complete?](https://community.postman.com/t/how-to-wait-for-an-async-pm-sendrequest-to-complete/29047)

<div class="topic-metadata">

**Author:** [@felipe.pazinatto](https://community.postman.com/u/felipe.pazinatto)\
**Replies:** 0\
**Last updated:** [October 24, 2021, 2:40pm UTC](https://community.postman.com/t/how-to-wait-for-an-async-pm-sendrequest-to-complete/29047 "2021-10-24T14:40:03Z")

</div>

Hi there, I\`m testing an API for which I POST a document, then need to check for the confirmation messages generated, this is the code: function validateDocumentMessage(expectedDocumentMessage) { var hasLegalStatus…

---

## [Access "Network" tab data from a javascript / test script](https://community.postman.com/t/access-network-tab-data-from-a-javascript-test-script/28859)

<div class="topic-metadata">

**Author:** [@spacecraft-meteorol2](https://community.postman.com/u/spacecraft-meteorol2)\
**Replies:** 0\
**Last updated:** [October 19, 2021, 9:36am UTC](https://community.postman.com/t/access-network-tab-data-from-a-javascript-test-script/28859 "2021-10-19T09:36:06Z")

</div>

Hello, In Postman GUI - after sending request - I can see “Network” data tab containing information such as “Remote Address”, “Certificate CN” and others. How can I access this data programatically, using javascript AP…

---

## [How to access the object name from the response having space in it?](https://community.postman.com/t/how-to-access-the-object-name-from-the-response-having-space-in-it/28731)

<div class="topic-metadata">

**Author:** [@jagrutiwani0](https://community.postman.com/u/jagrutiwani0)\
**Replies:** 1\
**Last updated:** [October 15, 2021, 9:59am UTC](https://community.postman.com/t/how-to-access-the-object-name-from-the-response-having-space-in-it/28731 "2021-10-15T09:59:55Z")

</div>

How to access the object name having space in it? I have the below response in the screenshot. How shall I access the “line 1” object from the array? Below is the code that I’m using- console.log(jsonArrayData\[0\].subli…

---

## [Writing a test on an alert from inspecting an element](https://community.postman.com/t/writing-a-test-on-an-alert-from-inspecting-an-element/24369)

<div class="topic-metadata">

**Author:** [@bkruep](https://community.postman.com/u/bkruep)\
**Replies:** 1\
**Last updated:** [June 2, 2021, 8:34am UTC](https://community.postman.com/t/writing-a-test-on-an-alert-from-inspecting-an-element/24369 "2021-06-02T08:34:03Z")

</div>

Hello I am not sure if this is possible or not as I am new to Postman but wanted to check. I am trying to write a test to confirm that a particular audit message on a page displays. I tried to get the audit message to …

---

## [Is it possible to run a custom external Javascript file from Postman pre-script](https://community.postman.com/t/is-it-possible-to-run-a-custom-external-javascript-file-from-postman-pre-script/23564)

<div class="topic-metadata">

**Author:** [@monish.narendra](https://community.postman.com/u/monish.narendra)\
**Replies:** 1\
**Last updated:** [May 9, 2021, 11:53am UTC](https://community.postman.com/t/is-it-possible-to-run-a-custom-external-javascript-file-from-postman-pre-script/23564 "2021-05-09T11:53:07Z")

</div>

Is it possible to run a custom external Javascript file from Postman pre-script. I have a JavaScript file (.js). Is there anyway of importing and running that JavaScript file (.js) from postman in pre-script.

---

## [How can I parse xlsx response in javascript to display in webpage](https://community.postman.com/t/how-can-i-parse-xlsx-response-in-javascript-to-display-in-webpage/21510)

<div class="topic-metadata">

**Author:** [@aravi.a620](https://community.postman.com/u/aravi.a620)\
**Replies:** 0\
**Last updated:** [March 17, 2021, 5:39pm UTC](https://community.postman.com/t/how-can-i-parse-xlsx-response-in-javascript-to-display-in-webpage/21510 "2021-03-17T17:39:48Z")

</div>

Hi, I have received the following response(from .xlsx file) in the network layer from the Javascript fetch API request. I would like to parse this response and display the correct format(Whether it is JSON or text) on th…

---

## [Can I reuse a JavaScript variable across requests?](https://community.postman.com/t/can-i-reuse-a-javascript-variable-across-requests/21436)

<div class="topic-metadata">

**Author:** [@TeacherManAlex](https://community.postman.com/u/TeacherManAlex)\
**Replies:** 3\
**Last updated:** [March 17, 2021, 3:30pm UTC](https://community.postman.com/t/can-i-reuse-a-javascript-variable-across-requests/21436 "2021-03-17T15:30:56Z")

</div>

Is there any way to preserve my Javascript environment across requests in a collection run? I need to use javascript to extract an ID in one request, and then use that ID in the next request in the run. I can do that u…

---

## [Add the ability to ignore/disable a block of tests at the collection level](https://community.postman.com/t/add-the-ability-to-ignore-disable-a-block-of-tests-at-the-collection-level/14806)

<div class="topic-metadata">

**Author:** [@babalisingh90](https://community.postman.com/u/babalisingh90)\
**Replies:** 4\
**Last updated:** [August 13, 2020, 8:16pm UTC](https://community.postman.com/t/add-the-ability-to-ignore-disable-a-block-of-tests-at-the-collection-level/14806 "2020-08-13T20:16:58Z")

</div>

In my collection, for all the requests I have 3 scenarios: when the response code is 200 and the response body is not empty. when the response code is 200 and the response body is empty. When response code is other tha…

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