I want to save selected column (e.g. column 1, 3, 5) when export to CSV File. AG default always save all fields. Please help me, and many thanks for your help.
My regards,
Soewandi
How to save selected column to export CSV
Re: How to save selected column to export CSV
Hi there,
You can customise the columns etc by specifying the query in the hooks/TABLENAME.php file.
Scroll down to the bottom, you should see the line like this...
Then, put your query inside the curly bracket above the
Example:
If nothing happen after you click the
Have a nice day.
You can customise the columns etc by specifying the query in the hooks/TABLENAME.php file.
Scroll down to the bottom, you should see the line like this...
Code: Select all
function TABLENAME_csv($query, $memberInfo, &$args) {
return $query;
statementExample:
Code: Select all
function booking_csv($query, $memberInfo, &$args) {
$query = "SELECT `booking`.`id` AS booking_id, `customer`.`name` AS customer FROM `booking` LEFT JOIN `customer` ON `booking`.`customer_id` = `customer`.`id` WHERE 1 = 1 ORDER BY `booking`.`id`";
return $query;
}
Save CSV
button, you might want to check if there is any error in your query under Admin Area -> Utilities -> Query logs
Have a nice day.
Zala.
Appgini 24.17, MacOS 14.6 Windows 11 on Parallels.
Appgini 24.17, MacOS 14.6 Windows 11 on Parallels.
Re: How to save selected column to export CSV
Yes, you exactly helped me. Many thanks Mr. Zibrahim
My warm regards
soewandi
My warm regards
soewandi