function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abilash.SAbilash.S 

JSON Serialize and display in descending order.

Hi Everyone,
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.

let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]

By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.

O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.