This would probably better (and more clear) as a list comprehension, since you're really just applying wh_json:get_value/2 to each element in the list.