CnMassImportDialog
File upload dialog with options and results summary. Supports importing data from files into OpenRegister.
Try it
Loading CnMassImportDialog playground…
Wraps: NcDialog, NcButton

Props
| Prop | Type | Default | Description |
|---|---|---|---|
dialogTitle | String | 'Import data' | |
acceptedTypes | String | '.json,.xlsx,.xls,.csv' | Accepted file types (input accept attribute) |
options | Array | [] | Additional import option definitions |
templateUrl | String | '' | Address of an empty file with the right columns; shows a download button when set. |
templateLabel | String | 'Download template' | Label of the template download button. |
mappingTitle | String | 'How the columns are read' | Heading of the column mapping table. |
columnLabel | String | 'Column in the file' | Header of the file column. |
fieldLabel | String | 'Field' | Header of the field column. |
notUsedLabel | String | 'Not used' | The choice that leaves a column out. |
checkFirst | Boolean | false | Offer a switch that checks the file first and imports nothing (dryRun in the confirm options). |
checkFirstLabel | String | 'Check first, import nothing yet' | Label of the check-first switch. |
checkFirstDescription | String | 'Shows which rows would fail and why.' | Helper line of the check-first switch. |
checkedText | String | 'Checked. Nothing is imported yet.' | Note shown after a check. |
fileTypeHelp | Array | [{ label, description }] | Help entries shown in the "Supported file types" list; defaults to JSON, Excel, and CSV entries |
canSubmit | Boolean | true | Whether the form is ready to submit. The parent can set this to false (via a slot) while required options are incomplete. |
successText | String | 'Import completed successfully!' | Message shown in the result phase when all rows imported without errors |
partialSuccessText | String | 'Import completed with errors. Check the details below.' | Message shown when the import finished but with some errors |
loadingText | String | 'Importing data — this may take a moment for large files...' | Text shown while the import is running |
summaryTitle | String | 'Import summary' | Heading above the result summary table |
supportedFormatsLabel | String | 'Supported file types:' | Label above the file type help list |
selectFileLabel | String | 'Select file' | Label for the file-picker button |
cancelLabel | String | 'Cancel' | |
closeLabel | String | 'Close' | Label for the close button shown in the result phase |
confirmLabel | String | 'Import' | |
sheetLabel | String | 'Sheet' | Column header for the sheet name in the summary table |
foundLabel | String | 'Found' | Column header for the found-rows count |
createdLabel | String | 'Created' | Column header for the created-rows count |
updatedLabel | String | 'Updated' | Column header for the updated-rows count |
unchangedLabel | String | 'Unchanged' | Column header for the unchanged-rows count |
errorsLabel | String | 'Errors' | Column header for the error count |
Events
| Event | Payload | Description |
|---|---|---|
confirm | \{ file, options \} | Import confirmed |
close | — | Dialog closed |
Slots
| Slot | Scope | Description |
|---|---|---|
#import-fields | \{ file \} | Extra fields below file upload |
Public Methods
| Method | Description |
|---|---|
setResult(\{ success?, error?, imported?, skipped? \}) | Set import result |
Live demo
<template>
<div>
<button @click="open = true" style="padding: 6px 16px; border-radius: 4px; background: var(--color-primary-element); color: white; border: none; cursor: pointer;">Import</button>
<CnMassImportDialog
v-if="open"
ref="dlg"
@confirm="onConfirm"
@close="open = false" />
</div>
</template>
<script>
export default {
data() { return { open: false } },
methods: {
async onConfirm(payload) {
await new Promise(r => setTimeout(r, 800))
this.$refs.dlg.setResult({ success: true })
},
},
}
</script>
Usage
<CnMassImportDialog
accepted-types=".json,.csv,.xlsx"
@confirm="onImport"
@close="showImport = false">
<template #import-fields="{ file }">
<NcCheckboxRadioSwitch v-model="overwriteExisting">
Overwrite existing records
</NcCheckboxRadioSwitch>
</template>
</CnMassImportDialog>
Reference (auto-generated)
The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnMassImportDialog.vue and update automatically whenever the component changes.
OpenRegister reliance
none: this component does not touch OpenRegister, directly or through anything it imports. 0 direct references, 0 files reached through imports.
See the reliance overview for the filterable list.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
dialogTitle | string | () => t('nextcloud-vue', 'Import data') | Dialog title | |
acceptedTypes | string | '.json,.xlsx,.xls,.csv' | Accepted file types (input accept attribute) | |
options | array | [] | Import option definitions | |
fileTypeHelp | array | [ \{ label: 'JSON', description: 'Configuration and objects.' \}, \{ label: 'Excel (.xlsx, .xls)', description: 'Tabular objects data with multiple sheets.' \}, \{ label: 'CSV', description: 'Single table of objects data.' \}, ] | File type help entries | |
canSubmit | boolean | true | Whether the form is ready to submit (parent can control via slot logic) | |
successText | string | () => t('nextcloud-vue', 'Import completed successfully!') | Success text when all rows imported without errors | |
partialSuccessText | string | () => t('nextcloud-vue', 'Import completed with errors. Check the details below.') | Text when import partially succeeded | |
loadingText | string | () => t('nextcloud-vue', 'Importing data — this may take a moment for large files…') | Text shown while importing | |
summaryTitle | string | () => t('nextcloud-vue', 'Import summary') | Heading rendered above the per-sheet results table. | |
supportedFormatsLabel | string | () => t('nextcloud-vue', 'Supported file types:') | Label for the "Supported file types" intro line. | |
selectFileLabel | string | () => t('nextcloud-vue', 'Select file') | Label for the file-picker trigger button. | |
cancelLabel | string | () => t('nextcloud-vue', 'Cancel') | Label for the cancel button (visible before the import runs). | |
closeLabel | string | () => t('nextcloud-vue', 'Close') | Label for the close button (visible after import completes). | |
confirmLabel | string | () => t('nextcloud-vue', 'Import') | Label for the primary confirm button that triggers the import. | |
sheetLabel | string | () => t('nextcloud-vue', 'Sheet') | Column header for the per-sheet results row label. | |
foundLabel | string | () => t('nextcloud-vue', 'Found') | Column header for the "rows found" summary count. | |
createdLabel | string | () => t('nextcloud-vue', 'Created') | Column header for the "rows created" summary count. | |
updatedLabel | string | () => t('nextcloud-vue', 'Updated') | Column header for the "rows updated" summary count. | |
unchangedLabel | string | () => t('nextcloud-vue', 'Unchanged') | Column header for the "rows unchanged" summary count. | |
errorsLabel | string | () => t('nextcloud-vue', 'Errors') | Column header / collapsible toggle for the per-sheet errors list. | |
templateUrl | string | '' | Address of an empty file with the right columns; shows a download button when set. | |
templateLabel | string | () => t('nextcloud-vue', 'Download template') | Label of the template download button. | |
fields | array | [] | The fields a row can fill, [{ key, label }]. With fields, a CSV or JSON file shows a table that maps each of its columns to a field or leaves it out; the file is uploaded with its columns renamed to the chosen fields. | |
mappingTitle | string | () => t('nextcloud-vue', 'How the columns are read') | Heading of the column mapping table. | |
columnLabel | string | () => t('nextcloud-vue', 'Column in the file') | Header of the file column. | |
fieldLabel | string | () => t('nextcloud-vue', 'Field') | Header of the field column. | |
notUsedLabel | string | () => t('nextcloud-vue', 'Not used') | The choice that leaves a column out. | |
checkFirst | boolean | false | Offer a switch that checks the file first and imports nothing (dryRun in the confirm options). | |
checkFirstLabel | string | () => t('nextcloud-vue', 'Check first, import nothing yet') | Label of the check-first switch. | |
checkFirstDescription | string | () => t('nextcloud-vue', 'Shows which rows would fail and why.') | Helper line of the check-first switch. | |
checkedText | string | () => t('nextcloud-vue', 'Checked. Nothing is imported yet.') | Note shown after a check. |
Events
| Name | Payload | Description |
|---|---|---|
close | — | |
confirm | — |
Slots
| Name | Bindings | Description |
|---|---|---|
fields | file |
Methods
| Name | Description |
|---|---|
setResult | Set the result of the import operation. |