Hi ,
I am getting a list from api response which is an array of JSON objects.
I need to sort it according to the dates. I am using ListSort in OnAfterFetch and list is sorted successfully. But when i use it in the screen List widget.. not able to get the sorted list in the UI List Widget.
This is my onAfterFetch action . and trying to use in the below expression container of my list .. but it is showing unsorted date.
Hi Sunku,
If possible, would you be able to share your file so we are able to see what is causing the issue?
Is your table connected to the ReporteesSorted variable? And not to the aggregate?
ReporteesSorted is a list type of local variable that has the sorted list .. i am using this in the List widget on my screen.
Hi @Sunku Sai Purnima,
I have few questions here.
1. Why are you using list sort inside of a loop? List sort doesn't return any output list as it will automatically sort the list based on the condition provided.
2. Why do you need another "ReporteesSorted" variable to store the sorted list as you can directly bind your UI with the main list which you initially sorted.
Directly sort the "Reportees" list without putting it in any loop and bind it directly with the UI. This should probably work.
Regards,
Prakhar Sharma
My requirement is ReporteesList is of type
[
{
"employeeId": "114775",
"name": "Puja Jha",
"job": "Senior Test Engineer",
"emailAddress": "puja.jha@bahwancybertek.com",
"journeyList": [
"transactionId": "TRNDOM011964",
"projectCode": "90006",
"projectName": "Marketing - BCT Support",
"purpose": "Travel",
"travelType": "Domestic",
"startDate": "2023-12-21 16:06:00",
"endDate": "2023-12-22 16:06:00"
},
"transactionId": "TRNDOM011966",
"startDate": "2023-12-20 12:38:00",
"endDate": "2023-12-21 12:38:00"
"transactionId": "TRNDOM011977",
"purpose": "Test",
"startDate": "2023-12-22 21:52:00",
"endDate": "2023-12-23 21:52:00"
"transactionId": "TRNINT011956",
"purpose": "Travel testing ",
"travelType": "International",
"startDate": "2023-12-20 13:27:00",
"endDate": "2023-12-21 13:27:00"
"transactionId": "TRNINT011958",
"purpose": "Testing ",
"startDate": "2023-12-20 15:59:00",
"endDate": "2023-12-21 15:59:00"
"transactionId": "TRNINT011960",
"purpose": "Travel test",
"startDate": "2023-12-22 16:52:00",
"endDate": "2023-12-23 16:52:00"
"transactionId": "TRNDOM011976",
"startDate": "2023-12-22 10:57:00",
"endDate": "2023-12-23 10:57:00"
"transactionId": "TRNINT011978",
"startDate": "2023-12-25 11:29:00",
"endDate": "2023-12-26 11:29:00"
}
]
The outer list has details that has to be listed in the list screen .. and i have to display the start date of the journey list of inner object that is sorted and also i need to print the end date of the last journey from the journey list
So for each of the outer element i am sorting the journey list to get first start date.. in the onAfterFetch when i used message box to display in the client action .. it is showing sorted start date but when i use the same list in the widget .. its not showing the sorted one.
ReporteesSorted i just tried to fix the issue..