You need to sign in to do that
Don't have an account?
Abilash.S
JSON Serialize and display List 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.
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.
Please follow below code but it not test my side
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh