I have a restapi Query in my Query Library that returns a JSON list of servers with each property being details about each server, e.g.:
[
{
"id": 355,
"serverIp": "10.10.10.1",
"hostname": "server1",
"serverType": "PS",
"active": true,
},
{
"id": 356,
"serverIp": "10.10.10.5",
"hostname": "server2",
"serverType": "XSP",
"active": true,
},
{
"id": 355,
"serverIp": "10.10.10.11",
"hostname": "server3",
"serverType": "XSP",
"active": true,
}
]
I would like to apply a transformer to the Resource (Import from the Query Library) such that only JSON objects returned by the Resource are servers where the "serverType" is equal to "XSP"
The returned value after the Transformer I am hoping for:
[
{
"id": 356,
"serverIp": "10.10.10.5",
"hostname": "server2",
"serverType": "XSP",
"active": true,
},
{
"id": 355,
"serverIp": "10.10.10.11",
"hostname": "server3",
"serverType": "XSP",
"active": true,
}
]
I have seen this article:
but I'm new to Retool and Java and I can't seem to modify it for my purposes and get it to return anything.
I very much appreciate any help!