Value from the variable of previous request test script

I have setup a webhook on Postman and added the webhook URL in another application (initiating webhook events). In order to enable the webhook on the application, it requires that the webhook event handler should respond to a certain value that is sent by the request from the application.


I have been able to get that value in the pre-request script but now I want that same value to be appended to the response that is sent by the postman webhook to the application.

This is what my pre-request script looks like. However, i am not sure how to further pass on this value in the variable to the next request.

Or if someone can tell me that I can post back from the same request with the header value that will also be helpful.

Hey @adilchughtai ,

You’d need to create a variable from that value:
pm.variables.set('hookHeader', xHookSecret)

And you’ll then be able to use it anywhere else in the rest of your execution using {{hookHeader}}.