Sorting a json list

enter image description here

I want to do the following:

Take all ‘id’ in all ‘name’ and sort them from least to highest
cut the list to 20 elements
get all the messages for those 20 ‘id’s

In the end, I want the 20 ids sorted from least to highest and I want to know their message and “name” field