# \#functions

**URL:** https://community.postman.com/tag/functions/461.md

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

---

## [Using pm.execution.setNextRequest to skip to the next folder instead of a request](https://community.postman.com/t/using-pm-execution-setnextrequest-to-skip-to-the-next-folder-instead-of-a-request/78557)

<div class="topic-metadata">

**Author:** [@annaboek](https://community.postman.com/u/annaboek)\
**Replies:** 3\
**Last updated:** [April 15, 2025, 2:01pm UTC](https://community.postman.com/t/using-pm-execution-setnextrequest-to-skip-to-the-next-folder-instead-of-a-request/78557 "2025-04-15T14:01:38Z")

</div>

While I’m on here thought I’d ask this question, I don’t think it’s possible. Is it possible to skip to the next folder name within a collection rather than the next request name using pm.execution.setnextrequest? Or i…

---

## [Deprecated Functions](https://community.postman.com/t/deprecated-functions/76926)

<div class="topic-metadata">

**Author:** [@nsocol](https://community.postman.com/u/nsocol)\
**Replies:** 1\
**Last updated:** [March 14, 2025, 12:15pm UTC](https://community.postman.com/t/deprecated-functions/76926 "2025-03-14T12:15:35Z")

</div>

When is support ending for deprecated functions like xml2Json?

---

## [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 …

---

## [Creating functions and reuse in other test scripts](https://community.postman.com/t/creating-functions-and-reuse-in-other-test-scripts/60467)

<div class="topic-metadata">

**Author:** [@docking-module-geol7](https://community.postman.com/u/docking-module-geol7)\
**Replies:** 1\
**Last updated:** [April 30, 2024, 11:00am UTC](https://community.postman.com/t/creating-functions-and-reuse-in-other-test-scripts/60467 "2024-04-30T11:00:29Z")

</div>

I have searched for the solution and found multiple answers but didn’t work for me. Under Collection Folder/Parent folder → Under Pre-request script .. \[Note - env\_amount is created under Collection Folder → Variables …

---

## [Proper way for async/await process?](https://community.postman.com/t/proper-way-for-async-await-process/59741)

<div class="topic-metadata">

**Author:** [@Harm10](https://community.postman.com/u/Harm10)\
**Replies:** 0\
**Last updated:** [April 9, 2024, 11:47am UTC](https://community.postman.com/t/proper-way-for-async-await-process/59741 "2024-04-09T11:47:47Z")

</div>

I am searching for a proper way to do this for days now. I seem not to find the proper example for my process wish. :slight\_smile: There is a lot of information on async/await/promise processes. A lot of them are dated …

---

## [Reusing Functions](https://community.postman.com/t/reusing-functions/59617)

<div class="topic-metadata">

**Author:** [@gourish-mahale](https://community.postman.com/u/gourish-mahale)\
**Replies:** 7\
**Last updated:** [April 5, 2024, 12:14pm UTC](https://community.postman.com/t/reusing-functions/59617 "2024-04-05T12:14:45Z")

</div>

Under Main Collections, I have created 2 folders which are defined at same level. Main Collection Reusable Function Folder With Feature Name1 Folder With Feature Name1 API Tests I’ve created a function inside Fo…

---

## [A pm.sendRequest from a function body in Postman doesn't work](https://community.postman.com/t/a-pm-sendrequest-from-a-function-body-in-postman-doesnt-work/25584)

<div class="topic-metadata">

**Author:** [@SBoris](https://community.postman.com/u/SBoris)\
**Replies:** 4\
**Last updated:** [March 14, 2024, 9:37am UTC](https://community.postman.com/t/a-pm-sendrequest-from-a-function-body-in-postman-doesnt-work/25584 "2024-03-14T09:37:43Z")

</div>

I’m trying to call a request from a function body in order to reuse code across a collection. But it looks like pm.sendRequest(request, function(err, response)… is ignoring. Where I’m wrong? The post is similar to this n…

---

## [Accessing Local Variables within a Global Function](https://community.postman.com/t/accessing-local-variables-within-a-global-function/48759)

<div class="topic-metadata">

**Author:** [@maclazaro](https://community.postman.com/u/maclazaro)\
**Replies:** 4\
**Last updated:** [June 23, 2023, 1:38am UTC](https://community.postman.com/t/accessing-local-variables-within-a-global-function/48759 "2023-06-23T01:38:17Z")

</div>

I am able to implement this: Collection Pre-requisite Script: utils = { hello: function() { return 'hello'; } } Request-level Test Script results to hello in my console when executing: console.log(uti…

---

## [Parsing serialized functions in pre-request or test scripts. Inconsistent behavior](https://community.postman.com/t/parsing-serialized-functions-in-pre-request-or-test-scripts-inconsistent-behavior/42992)

<div class="topic-metadata">

**Author:** [@tmladenov\_atos](https://community.postman.com/u/tmladenov_atos)\
**Replies:** 0\
**Last updated:** [January 18, 2023, 9:14am UTC](https://community.postman.com/t/parsing-serialized-functions-in-pre-request-or-test-scripts-inconsistent-behavior/42992 "2023-01-18T09:14:43Z")

</div>

Hi, You have the following code in a pre-request script or test script: const src = "function myFunction() {console.log('Hello, world!')}; myFunction()"; const func = new Function(src); func(); Running this in NodeJS …

---

## [Make logging and tests results easy with custom pm functions](https://community.postman.com/t/make-logging-and-tests-results-easy-with-custom-pm-functions/33614)

<div class="topic-metadata">

**Author:** [@rtfmoz2](https://community.postman.com/u/rtfmoz2)\
**Replies:** 14\
**Last updated:** [November 26, 2022, 2:47am UTC](https://community.postman.com/t/make-logging-and-tests-results-easy-with-custom-pm-functions/33614 "2022-11-26T02:47:59Z")

</div>

Go from this… Pre-Request Script // Clear env vars at start of run names = \[ "access\_token", "refresh\_token", "oid\_token", "resumeURL", "loginURL", "auth\_code", "opentoken" \]; for (index in names) { if (obj.hasOwnProper…

---

## [How can we create function in case of Postman flows](https://community.postman.com/t/how-can-we-create-function-in-case-of-postman-flows/38831)

<div class="topic-metadata">

**Author:** [@research-saganist-70](https://community.postman.com/u/research-saganist-70)\
**Replies:** 1\
**Last updated:** [September 9, 2022, 8:34pm UTC](https://community.postman.com/t/how-can-we-create-function-in-case-of-postman-flows/38831 "2022-09-09T20:34:43Z")

</div>

I have to decode the jwt to fetch the details and use it in subsequent requests. In the collection I created a function to perform this action and was setting the environment variable to use in requests. Now the option a…

---

## [Postman Flows - How to create a Durable with the Array length of a Request response body](https://community.postman.com/t/postman-flows-how-to-create-a-durable-with-the-array-length-of-a-request-response-body/34001)

<div class="topic-metadata">

**Author:** [@material-specialist6](https://community.postman.com/u/material-specialist6)\
**Replies:** 1\
**Last updated:** [March 29, 2022, 10:13am UTC](https://community.postman.com/t/postman-flows-how-to-create-a-durable-with-the-array-length-of-a-request-response-body/34001 "2022-03-29T10:13:49Z")

</div>

Hello all, I’m trying to create a Postman flow that has the following logic: - Executes a GET call on system A, which return a JSON Array, of length X. - Executes a GET call on system B, which return a JSON Array, of …

---

## [Please help with execution order while using a collection-pre-request-defined function in a pre-request script](https://community.postman.com/t/please-help-with-execution-order-while-using-a-collection-pre-request-defined-function-in-a-pre-request-script/31761)

<div class="topic-metadata">

**Author:** [@satellite-architect2](https://community.postman.com/u/satellite-architect2)\
**Replies:** 0\
**Last updated:** [January 20, 2022, 9:25pm UTC](https://community.postman.com/t/please-help-with-execution-order-while-using-a-collection-pre-request-defined-function-in-a-pre-request-script/31761 "2022-01-20T21:25:41Z")

</div>

My question: I’ve ilustrated my question in the following scenario: i have collection pre-request where i define an object that contains a function that returns the value of an environment variable. In my request, i h…

---

## [Writing smart Tests using Dynamic Variables and functions!](https://community.postman.com/t/writing-smart-tests-using-dynamic-variables-and-functions/18475)

<div class="topic-metadata">

**Author:** [@bpricilla](https://community.postman.com/u/bpricilla)\
**Replies:** 0\
**Last updated:** [December 15, 2020, 5:06am UTC](https://community.postman.com/t/writing-smart-tests-using-dynamic-variables-and-functions/18475 "2020-12-15T05:06:28Z")

</div>

Hello Folks :blush: Hope everyone is doing good and getting ready for 2021!! While testing your API’s its advised to write more re-usable and efficient test cases. One such practice can be: Try to use more Dynamic vari…
