CSV select some columns but not all #681
Unanswered
SebastiendOrnano
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hello! If I understand well, you want to let users download a csv with a variable number of columns. This is quite unusual, but possible. You can use the dynamic component to pass a json array of objects to the csv component, and json_group_object to generate the objects with a variable number of properties. Overall, this is much more complicated than just selecting the subset of columns to download yourself. Isn't there a few subset of columns that make sense together and they you could offer your users a hard coded options? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to find a way to download a csv file but only on chosen columns.
I prepared a form to select the columns. I tried to use directly the variables in a select query inside the cvs component until I understood that in sqlite it is not possible to use variables in a query (I am still an early learner in sql !). The only way is to introduce some python function but I want to stay on pure sqlpage.
So I send the result in a table and try to use one row of this table as argument in the select component but with the problem as it seems to be difficult to introduce a sub-query in a select query without an external function in python.
I tried to use json_array but I am still stuck.
So someone has an idea, thanks to him or her !
Beta Was this translation helpful? Give feedback.
All reactions