Group results within an API

Options

Hi everyone!

I'm building a journaling app and have a page that allows users to view all their entries. They are currently presented as different items: ie. every entry is separate, even if written on the same day:


How can I structure my API so that they are grouped by date: ie. every entry done on the 02.Jan.2022 is one group, like this:


Here is the function stack I have currently (it decrypts each entry):


And here is the output:


Thanks, any help much appreciated.


(I'm using Draftbit as a FE incase that's important)

Best Answer

  • evanwaller
    evanwaller Member
    Answer ✓
    Options

    Hey Steve,

    On a very high level, I recommend using the aggregate feature in the sort component of the output tab. Within the aggregate function choose to group by “created_at” and have them grouped by the day they were created.

    Let me know if you need any more assistance by tagging me in any new comment.

    -Evan

Answers