Forums

export csv from a filtered list

silvered.dragon 20 Nov, 2019
Hi to all,
I have a list that is filtered through some custom fields and a date picker. The list and filtering are showing fine, now I want to add a button to export in csv the list after is filtered.
The list is provided by a read data function {function:read_disponibilita_ig}

what I tried is to:
  1. create a csv export function "csv_export" with data provider {var:read_disponibilita_ig.[n].read_disponibilita_ig}
  2. create a new event "export"
  3. add to the export event this content {function:read_disponibilita_ig} {function:csv_export}
  4. create a link button that is linking to the export event

this is working but obviously this will export the entire db read function, not the filtered one by the custom fields.
How can I pass the filtered var from one event to another? Or maybe is there a way to run the csv_export function on click in the index event, without start automatically the download when the event is loaded? it's a little difficoult to explain...
silvered.dragon 20 Nov, 2019
Answer
Oh my it wa simple, just added into "URL and/or URL parameters" of the link button the keywords that I used for the filtering fields!
joaoparao 26 Feb, 2021
Hi, Silver.dragon,
can you say exactly what you mean by "the keywords that I used for the filtering fields"? Can you give me an example?
Thanks
Joao
This topic is locked and no more replies can be posted.