Hi guys,
I don't find a solution for my problems (or I search to much... :? )
I want create an alias like
For example, I want "Miller, Michael" in the csv-file.
Theres only Columns/Titles, Data Path and so on, it's possible to set an alias for one field, but how can I set an aliasstatement with 2 ore more fields?
Michael
I don't find a solution for my problems (or I search to much... :? )
I want create an alias like
select concat (lastname,', ', firstname) as name
in the forms->Setup->CSVExport.
For example, I want "Miller, Michael" in the csv-file.
Theres only Columns/Titles, Data Path and so on, it's possible to set an alias for one field, but how can I set an aliasstatement with 2 ore more fields?
Michael
Hi frimi,
The simplest way to do this is to load the data using a DB Read action, then use a Custom Code action to loop through and process it before using the Data Path option in the CSV Export action to do the export.
Assuming that the DB Read has a model ID of 'my_data' the Custom Code will be something like this:
Bob
The simplest way to do this is to load the data using a DB Read action, then use a Custom Code action to loop through and process it before using the Data Path option in the CSV Export action to do the export.
Assuming that the DB Read has a model ID of 'my_data' the Custom Code will be something like this:
<?php
foreach ($form->data['my_data'] as $k => $v ) {
$form->data['my_data'][$k]['name'] = $v['last_name'].', '.$v['first_name'];
}
?>
Bob
This topic is locked and no more replies can be posted.