Background:
I have been using Postman Collection to automate extraction and parsing of body of API responses. This can be done via the Pre-request and Tests scripts that are executed before and after the Request is made.
I am able to perform tasks such as JWT Token Parsing, string manipulations, as well as various other checks. The values can then be passed on to a different Postman Request. (I understand variable modification is not supported in Postman Flows)
I do not see such capability in Postman Flows to execute such scripts. I am bounded by the Blocks that are available in Postman Flows.
My Question:
-
How do I run custom scripts in Postman Flows as to pass on the calculated values to the next Block?
-
How do I convert an extracted JSON string (e.g. ’ { “field1” : " value1", “field2” : “value2”}') back into a JSON object that can be read by a Postman Flows Block?
I’ve already tried:
-
Can’t find a way to run custom javascripts
-
Fed string ’ { “field1” : " value1", “field2” : “value2”}’ as input to Create Data block. Doesn’t detect it as a JSON object.
Current version:
Postman for Windows
Version 9.29.2
UI Version 9.29.2-ui-220818-1441
Desktop Platform Version 9.29.0
Architecture x64
OS Platform win32 10.0.19044