Find and replace text, code, and variables in Postman

“Find” but no “Find and Replace”? We’ve received a lot of customer requests for a replace feature to accompany our search feature, so we’re excited to announce that you can now find and replace within the Postman app!

Maybe your team has deprecated a feature and now faces the challenge of mass deleting every trace of that feature from all of your documentation. Or perhaps you named a function getKilometers, only to realize later that you definitely should have named it getMiles instead. The replace feature in Postman can save the day—or at least save a few hours of combing through  code to make changes one at a time.

Now you can change copy, redefine functions, and assign variables in the Postman app with reckless abandon, knowing that you can find and replace your way out of any regrettable naming decisions. 

Simply click on the “Find” icon in the status bar or hit ‘CMD+SHIFT+f’ on Mac or ‘CTRL + SHIFT + f’ on Windows and Linux devices to perform bulk replace operations on collections, environment and global variables, and requests and examples in open tabs. The replace feature is available in Postman 6.5 on Mac, Windows, and Linux platforms.

Happy finding and replacing everyone—use your new powers wisely.

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

9 thoughts on “Find and replace text, code, and variables in Postman

    I need to substitute part of the body request with 2 json key-values pairs. I figured out the find regexp using https://regex101.com/ and it works, but I can’t find how do I add new line in substitution string. Could you pls suggest?
    for example [\r\n\t\v]+”key1″: “value1”,[\r\n\t\v]+. to be replaced with “key1”: “value1”,\n “key2”: “value2”,\n.
    It does not interpret \n and uses it as a string, unfortunately.

    Can’t replace with an empty string?

    The replace feature is not working at all. tried to replace strings in URL, but no luck.

    Hi, Thanks for this blog post. It helped me and my team a lot.

    Hi, I am wondering, why that feature is still buggy 4 years later? See the following issue: https://github.com/postmanlabs/postman-app-support/issues/10537
    It’s still hasn’t fixed yet.
    Also, why the postman team has closed that issue without fixing it? The workaround mentioned there is far from the proper solution. On Windows OS to empty the local data (as described here: https://support.postman.com/hc/en-us/articles/4410785125271#h_01GGSSGBSFAKVHZ7QDKHZ16B43) you need to uninstall the Postman and reinstall it again every time you need to fix the issue.
    Do you think it is the perfect solution?

    This looks absolutely brilliant. 👏🏻
    So let’s say I have created an environment variable named ‘consumer_token’ and I want to change it to ‘consumer_token1’, will this change the variable name in the environment panel as well as every placeholder {{consumer_token}} -> {{consumer_token}} reference to it?

    Thanks. This worked fine for me.