List of JSON objects using camunda spin

I’m trying to use camunda spin to create a process variable from the JSON response of an API.

The API sends the response as a list of JSON objects. For example, [{“a”:1, “b”:2}]. In this case, I would be trying to extract the value of b and assign it to the process variable, but I’ve only found help for responses as a simple JSON object.

I’m struggling to extract the first object in the list, and then assign the value of b to the variable.

I’ve tried various combinations of elements, elementList, get, but all of them send a null response.

An example of what I’m trying to do is basically: S(response)[0].prop(“b”).numberValue();

Thank you for any help!

S(response).elements().get(0).prop(‘b’).value()

https://docs.camunda.org/manual/7.6/reference/spin/json/01-reading-json/#fetch-array-of-data

Thank you!