Skip to main content
jasonb7867
February 10, 2024
Question

Group a record list by date

  • February 10, 2024
  • 8 replies
  • 0 views

Hello, 
I'm currently building an audit history for my job. The way our client wants the history displayed is grouped by the date that the history action is created on. So that the list sometimes displays 1 action per timestamp and sometimes 2 or 3 actions by timestamp. We have found a way to do this but it is complicated. I get all the values in the histActionOn, then I uses union() to get only the unique values. From this point I can do more complex indexing to organize all the actions by date, or I can throw a a!queryRecordType() in a for loop and filter it by the histActionOn field. This gets exactly what I need. A record list with actions separated by date and time, but it's incredibly inefficient as it puts a query in a for loop. I'm sure there's a way to group all the actions by unique dates, but I don't know a way at this point. 

Any thoughts?

Thank you

Jason

    8 replies

    stefanhelzle0001
    Brainy
    February 10, 2024

    Did you consider using a custom record field to extract just the date and then aggregate on that?

    jasonb7867
    February 10, 2024

    I thought aggregation could only be done on charts and graphs.

    stefanhelzle0001
    Brainy
    February 10, 2024

    a!queryRecordType supports all the features.