You can write JavaScript code and reference its output elsewhere in your notebook to create an interactive experience. For example, you can add a script runner block that generates a random number and use that number in a request block that accepts one. You can also import external libraries.
To add a script runner block, do the following:
Postman runs the code and returns the result. To see the logs, open the Logs tab.
You can reference your script runner block by name. For example, if you name your script runner block “randomNumber”, you can reference its output in a request block with the syntax {{randomNumber}}. Or you can reference it in another script runner block with the syntax $randomNumber.
To reference your script runner block, do the following:
Open your notebook or create a new one.
Get your script runner block’s name.
Reference your script runner block:
{{scriptRunnerName}}.$scriptRunnerName.Last modified: 2025/11/04