The Postscript feature is very useful when you want to use coded variables on different API requests. With this feature, you can access then throughout your automated flow. This is helpful when you need to store and use information from a previous API request in subsequent requests.
In this test case we have an API returning a list of fruits as a JSON object.
From that list, we'll be extracting the name and the calories from the "Apple" object and use it on our next requests.
Extracting w/ Postscript
constapple=$.find((fruit)=>fruit.name=="Apple");// the $ represend the whole json response object// we then use an array method to find the "Apple" object
We can now access this object and it's attributes such that: