Howdy, is there a way to nest functions in as part...
# community-help
r
Howdy, is there a way to nest functions in as part of a json value? e.g.
object.(KEYS(object)[0])
or am I missing a simpler way to grab the first and only key out of a specific object when the actual name of the key will change from event to event
b
I think GET is what you’re after:
Copy code
GET(object, KEYS(object)[0])
does that work, @ripe-tailor-83334?
f
I know that for array
object.first
works for me. Here is an exemple
parse_response.actions.first.value
where actions is an array
m
Hey @ripe-tailor-83334 can you share one or two events as examples of how the keys could change so we can take a look?
I think Stephen’s “get” approach could be best here but we have a few other avenues!
r
oops forgot to turn around on this. the GET worked great for what I needed, and I nested it a few more times to get all the way down to what I needed:
GET(GET(GET(object, KEYS(object)[0]), 'value-1'), 'value-2')
Appreciate the help!
m
Awesome!