Hi ,
I have list of certain records so need to fetch minimum date value from that records.
Hello Vivek,
If its a list sort it using creation date ascending and fetch first record of sorted list. You have action listSort and give it sort attribute and direction then fetch ListSort.List.current
I have one column in records so what I did use Listsort. In Listsort passing filtered list then in By passing column name then ascending is true and after that I will get minimum date for current Listsort output rt? But I cant see Listsort while assigning
Thats correct but I don't understand what you mean by can't see listsort.
If you can't find action itself just write into search ListSort, if you couldn't see action click Search in other modules then add this action as dependancy
Sorry, in assignment you will make yourVariable = yourListName.Current or
yourVariable = yourListName[0]
Hi Vivek
To achieve this you can -
1.Create a server action that takes the list of records as input.
2.Inside the server action, use the List Sort action to sort the input list based on the date attribute ( "Ascending" sort direction).
3.After sorting the list, the minimum date value will be at the first position (index 1) in the sorted list. Assign this minimum date value to a local variable or return it as the result of the server action, based on how you want to use the result.
Hope this helps
Thanks
Hi Alka,
Just a quick update to your answer, the first position will be index 0 not 1
Ya in list the indexing starts from 0.
Thanks for the update.
Hi @Vivek Pandurang Pandile
Below are the pseudo steps to achieve your requirement:
1. Go to manage dependency and from system select list sort according to your requirement select client side or server side list sort method and apply.
2. Then call the list sort in the action flow.
3. Set the list and assign the attribute in By property to sort by date attribute and then set the direction of sorting as ASC.
Finally, store the value from the list at 0 index as minimum date value.
Hope this helps you.
Thanks & Regards.
Hello! Can you please explain this last step " store the value from the list at 0 index as minimum date value. "?