Export - failed rows

I have a few exports, which works mostly fine. But in some cases, in the notification, I am getting .... (Number1) row exported. (Number2) row failed to export. However, there is no entry in the log file about the failed rows and why they failed. Therefore, I am unable to find which rows are failing and why they are failing! Is there any way to get more info on this? Thanks in advance for any help .
4 Replies
Mohamed Ayaou
Mohamed Ayaou4d ago
By default the notification should be created with an action to download the failed rows with an additional column containing the error message Can you share the code and any customizations you might did to the default export action
Anish
AnishOP4d ago
Here it is :
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your application export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';

if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}

return $body;
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your application export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';

if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
}

return $body;
}
Mohamed Ayaou
Mohamed Ayaou3d ago
seems fine for me. maybe try to dd the $export
Anish
AnishOP3d ago
Ok. Will try that.

Did you find this page helpful?