board logo
Posted by: WUICTeam - Saturday, November 21, 2026 9:01:42 AM
[b]Question[/b] I import an Excel file with a few hundred rows and one of them fails (a lookup description that does not exist, a value the database refuses). Are the other rows saved or not, and how do I try the file without writing anything? [b]Answer[/b] It depends on [c]commit_level[/c], an option of [c]md_props_bag.import[/c] that is also shown as a dropdown in the import dialog (unless [c]skipsettings[/c] is [c]true[/c]). The default is [c]R[/c]. The whole file is always one transaction; the level only decides what happens at the first error. [list] [*][b]R[/b] (rollback): the import stops at the first failing row and everything is rolled back. Nothing is saved. [*][b]I[/b] (stop): the import stops at the first failing row and the rows already processed are committed. Exception: when the error is a lookup that cannot be resolved (description not found, key and description that do not match), [c]I[/c] behaves like [c]R[/c] and saves nothing. [*][b]C[/b] (continue): the failing row is logged and skipped, the import goes on, and the good rows are committed at the end. [*][b]T[/b] (test): same as [c]C[/c], but at the end everything is rolled back. The log reports "Total records to be inserted / updated" and "Test completed successfully" or "with N errors". [/list] [b]How to use it[/b] Run the file once with [c]T[/c], fix the rows listed in the log, then import with [c]R[/c]. To make the dry run the preselected choice in the dialog: [code]{ "import": { "enabled": true, "import_type": "I", "commit_level": "T", "skipsettings": false } }[/code] [b]Mistake to avoid[/b] With [c]C[/c] the import ends with "Import completed with N errors" and the good rows are already committed: the file is partially imported. Do not simply re-run the same file: unless the file carries the primary key and [c]import_type[/c] is [c]"I"[/c] (insert-only, existing keys are skipped), the rows already saved are inserted again. Correct and import only the failed rows. [url=https://wuic-framework.com/docs/import]Documentation: Import[/url]