Buy Now
Sign in

​How to re-use the selected value in a dropdown used to filter one event to filter a download CSV event.

farscape , August 26 at 11:34
Answered
F
farscape
I have a form that pulls data from a survey. The user can select a question from the dropdown, click a submit button, and see the list of respondents and their answers for the selected question. ​
​​
​I want to be able to create the option to download that list to a CSV after I see it. I've created a toolbar button to do that. When I choose the question, I see the results I expect, but when I click the button, the spreadsheet downloads, but it is empty save for the characters  in cell A1.​
​​
​My original attempt was, in the read_data option for the download, to use the same filter I used in the event that used the read_table for the displayed list. I make that selection via a dropdown with the name "choose_question", so my filter for the read_data for the list view is answer:{data:choose_question}.​
​​
​I've tried several alternatives, all either display those three characters or a completely empty spreadsheet.​
​​
​One scenario I tried was to put the read_data function and the download function into the event that displays the result, so that the spreadsheet downloaded at the same time the selected list displayed. ​
​​
​That worked.​
​​
​So it would seem that the dropdown selection is available only for the results of clicking the submit button.
Is there a way that I can accomplish the result I want?​
​​
​Thanks!
healyhatman
You'll either need to store the data in session or reread it
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman
F
farscape
Thanks. I had tried that completely with shortcut commands, but it didn't work. After your response, I noticed that the functions included a "save to session". I tried that and put table_element: {session:saved_variable_name} into the event and that did it.
Thanks!