Filtering and export as CSV

Hi all,

I created a simple front-end for users to review records I query from a database. I used scrivener (+scrivener_ecto and scrivener_html). Now I am trying to figure out what is the best way to allow them (the users) to filter by column value (Excel like) and export selected/filtered records to CSV. I do not want to reinvent the wheel, if there is a library out there I could use I’d love to know about it.

Thanks!

What do you mean by saying they will be “reviewing records”, exactly?

I usually have a Context.list_resources which accept enough parameters to do filtering and pagination. Something like…

  • offset
  • limit
  • filter

Once You have this query, it’s easy to transform the result to csv, with nimble_csv.

I do not use a library for filtering and pagination, but let ecto do it’s job.

See the records

Thanks

I have an example in this post…

1 Like

Thank you!