Define which columns are exported using CVS Export

alisamii

Member
Is there a way to control which columns are included or not included when exporting form data to CSV?

At the moment, when I export to CSV, the resulting CSV file has each column exported twice.

For example, if my form is collecting the submitter's First Name, Last Name and email address, the CSV export has 6 columns as follows:

first_name, first_name_raw, last_name, last_name_raw, email, last_name_raw

I would like to limit the export to first_name, last_name, email

Is that possible? If so, how?
 
hi
Yes, edit the list and under the publishing -> csv section, set the 'Include raw data' option to 'No'
Note in doing this re-importing of the data may not be possible if you use database join / cascading dropdown elements (as you will only export their labels and not their values)
You can also stipulate which fields are exported by pressing the 'elements' button and selecting which element's should be exported
 
OK, that seems to work but I have one issue.

In some of the field values, I have html in order to format some aspects.

For example, in my form, there is a "Field Trips" option which has a counter.

The value of the element is:

HTML:
Souss Massa National Park<div class="places-left muted"><span id="f1" class="badge badge-success">XX</span> Places left</div>

What I want to export in the CSV is just this:

HTML:
Souss Massa National Park

How can I strip the CSV export to just include that part.

In another instance, I have the value set to this:

HTML:
<strong>Monday, February 24:</strong> Symposium

In this case, I just want to strip the <strong> tag

Is there a way to control what parts of the value are striped?
 
hi sorry no there isn't you can either have the raw values which are stored in the database OR the values that are displayed in the list view.
 
hi sorry no there isn't you can either have the raw values which are stored in the database OR the values that are displayed in the list view.
 
alisamii, why don't you create a hidden "calc" element and then do the stripping there?

code would be something along lines of

Code:
$mystrippedelement = str_replace('{list___htmlelement}','<strong>','');
 
return $mystrippedelement;
 
  • Like
Reactions: rob
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top