Hi all:
I’m importing an Excel file, with the “Import records as import only” uncheked, in order to get the existing data updated.
I want to send an email to the user with the new data imported.
I know I can’t check it in the “row_import” event, with a SELECT, and if I get a record, it exists.
I was just wondering if it’s any other way of doing it to avoid making the SELECT and then the INSERT or UPDATE.
Thanks in advance
You may use “Page_Imported” server event to do that. This event will be executed after import is completed. You may use $reader object to expose the data reader, just write this code in that event to check:
var_dump($reader);
Thanks mobhar:
I’ve tried, but no info displayed, I’ve tried with die() too after the var_dump, but no info… (v2019)
function Page_Imported($reader, $results) {
var_dump($reader); // Import data reader
var_dump($results); // Import results
die();
}
If I comment die(); I see no var_dump info not the modal import form (I just see the “Imported sucessfully” message. When I close the modal, no info too.
If I let the die(); I get a “Server error 200: OK” and in the console (network) I get:
object(PhpOffice\PhpSpreadsheet\Reader\Xlsx)#115 (8) {
[“referenceHelper”:“PhpOffice\PhpSpreadsheet\Reader\Xlsx”:private]=>
object(PhpOffice\PhpSpreadsheet\ReferenceHelper)#117 (0) {
}
[“readDataOnly”:protected]=>
bool(false)
[“readEmptyCells”:protected]=>
bool(true)
[“includeCharts”:protected]=>
bool(false)
[“loadSheetsOnly”:protected]=>
NULL
[“readFilter”:protected]=>
object(PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter)#116 (0) {
}
[“fileHandle”:protected]=>
NULL
[“securityScanner”:protected]=>
object(PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner)#118 (2) {
[“pattern”:“PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner”:private]=>
string(9) "
NULL
}
}