CSV Export - Dynamic columns

Set dynamic columns in a CF CSV export.

Overview

The standard CSV Export action requires static column definitions, but the needed columns vary based on form submissions.
Use a data path to specify a sub-array in the form data for export, then apply custom code to dynamically select the inputs within that array.

Answered
me megana 03 Aug, 2015
The columns I want to include in my CSV Export will vary depending on how the form is filled out. I've got the column list loading into a variable (such as $form->data['columns'] = "id, name, email";) but how do I get the variable to work with the Columns/Titles field in the CSV Export action?
Gr GreyHead 04 Aug, 2015
Answer
1 Likes
Hi Megana,

Hmmm - I've never seen this request before. I suspect you might be able to get it to work by specifying a data path i.e. a sub-array of the $form->data[''] array to export then, using Custom code to select the inputs in the sub-array, you can probably do this.

Bob
me megana 04 Aug, 2015
Ooh I gotcha. Thanks I'll do that!
This topic is locked and no more replies can be posted.