Question: how to transform response variables nicely?
See original GitHub issueI’m looking for a nice way (one-liner?) how to transform/extract data from a response into a variable. Example
### Foos
# @name foos
GET /v1/foos
returns:
{
"items": [
{
"id": 1
}
]
}
Now I want to continue with the first object in the array:
### Foo
# @name foo
GET /v1/foos/{{foos.items[0].id}}
This is ok, but I want to apply foo
in multiple requests and, given a larger array switch to another array index. So I have in mind that AFTER the response I store the object in foo
and can continue:
### Foos
# @name foo
GET /v1/foos
{{exports.foo = foos.items[0].id}}
But this doesn’t work as it’s taken a request body. Any idea how to solve this nicely?
Issue Analytics
- State:
- Created a year ago
- Comments:28 (28 by maintainers)
Top Results From Across the Web
Lesson 7: Transformations & Interactions | STAT 462
Transforming response and/or predictor variables therefore has the potential to remedy a number of model problems. Such data transformations are the focus ...
Read more >When and How Should I Transform my Response Data?
In this blog we will explain when you should consider transforming the response, and how to choose a response transformation.
Read more >Understanding the transformation on response variable
I'm working with regression models, attempting to understand transformations a bit more. I'm modeling (Y~X) and I get an R2 of 0.4. I...
Read more >Data Transformation
We will address transformation to meet the homogeneity of variance assumption momentarily (even though it is best to conduct the variance transformation first, ......
Read more >A guide to Data Transformation - Medium
Improve interpretability. Some variables are not in the format we need for a certain question, e.g. car manufactures supply miles/gallon values ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
btw. just bumped my files & plugins to latest version. It a looks good now, the response var transform makes it soooo nice! thx
thanks for the fix/feature. will test it. Still unsure if
==
syntax is best choice as used as comparison in other languages. what’s the difference of@slideshow=={{response.parsedBody.slideshow}}
and@slideshow={{response.parsedBody.slideshow}}
then. First works, second is still cast to string?