# Pm.request name undefined

**URL:** <https://community.postman.com/t/pm-request-name-undefined/29501>\
**Category:** Help Hub\
**Created:** [November 8, 2021, 4:17pm UTC](https://community.postman.com/t/pm-request-name-undefined/29501 "2021-11-08T16:17:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nguyens](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@nguyens](https://community.postman.com/u/nguyens)\
**Post date:** [November 8, 2021, 4:17pm UTC](https://community.postman.com/t/pm-request-name-undefined/29501/1 "2021-11-08T16:17:49Z")

</div>

I’m currently following a guide where I can save response bodies as a txt file.  
It is working but i wanted to name the response.txt file as the request name.

Unfortunately i don’t get the request name .

I’ve tried to use console.log (pm.requestName); but it gives me only undefined.  
As well as for console.log(pm.info.requestName).

The Video which i am watching is this one

[![](https://img.youtube.com/vi/cCRmry10874/maxresdefault.jpg "How to programmatically save the response to file in Postman") ](https://www.youtube.com/watch?v=cCRmry10874&t=648)

and at that point he shows how to get the request name through the debugger but for me there is no Request Name. Is this because my request name is undefined?

![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/6/e6e0503c488daa7da372db18c6abe5d739355028.png)

---

<div class="post-metadata">

**Author:** ![jestrab](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@jestrab](https://community.postman.com/u/jestrab)\
**Post date:** [June 20, 2023, 9:01pm UTC](https://community.postman.com/t/pm-request-name-undefined/29501/2 "2023-06-20T21:01:34Z")

</div>

in the current version June 2023 (v10.15)

you can get the request name using “request.name” within the test and pre-request scripts.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/c/0/c0c14dade804819318180aeae8380478a2431f5b.png)

This shows the output in the console:  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/d/ad255d896fa89084ea9303f5ae25677c02aa5a23.png)
