Parsing REST API result in keyword test
Ok, so now that I've successfully called my REST API from my keyword test, how do I parse the result (presumably JSON, although I can just as easily return XML)? Do I need to roll my own script code or is there something in the world of keyword tests that will help me? If I need to write JavaScript to parse the JSON, a quick Google search turns up plenty of examples of how to do that. I'm really asking about the "big picture" and whether or not I can get from here to there entirely in the "keyword test" world.
A complete functional example (call a REST API with a GET verb, pull an answer out of the result, and use the answer later in the keyword test as the value to enter into a text box) would be really, really helpful!
EDIT: Thanks Alex for the guidance re: getting the LastResult. I've updated my own answer to my question accordingly.
After a bit of fiddling with the product (bear in mind, I'm learning as I go along... I just started using TC a few days ago), here's a sequence of KeywordTest steps that calls the petstore API and parses out a value from the result.
// Call the petstore API. This returns a JSON string
SendRequest | "GET", "http://petstore.swagger.io/v2/store/inventory"
// To get the JSON string from the previous call, I need to use a Set Variable action to fetch
// the magic LastResult (i.e. the JSON string returned by the previous API call)
Set Variable Value | apiResult [Local] | LastResult
// Now that I have the JSON string, parse it and store the result in a variable I can use later
// in the Keyword Test. In this example, I'm parsing the "sold" member.
Set Variable Value | value [Local] | JSON.parse(KeywordTests.MyTest.Variables.apiResult).sold