# Doclib Import Documents From Template
Imports documents from a template folder into a document library by processing rows from an Excel file. The template source is defined in the DocLibCfg template in config.json.
Filename pattern: filename must contain DoclibImportDocumentsFromTemplate (case-insensitive).
Example: 20240115 DoclibImportDocumentsFromTemplate setup.xlsx
# Columns
| Name | Required | Description |
|---|---|---|
| Url / SiteUrl | Conditional | Server-relative URL of the target document library. Required when MatterCode is not provided. |
| MatterCode | Conditional | Matter code used to resolve document libraries from the matter list. Required when Url is not provided. Imports into all document libraries for the matter. |
| ClientCode | No | Client code used together with MatterCode to identify the matter. |
| DoclibSet | Yes | Name of the DocLibCfg template in config.json. |
| SourceFolderUrl | No | Server-relative URL of a specific source folder to import from. If omitted, the import uses the template default source. |
| Properties | No | Any additional columns are collected as properties and passed to the template lookup and import operation. |
Either Url or MatterCode must be provided. DoclibSet is always required.
# Behavior
Resolves the target library and copies documents from the template source defined in the DocLibCfg. When SourceFolderUrl is provided, only documents from that specific folder are imported; otherwise the full template source is used. When targeting by MatterCode, the import runs against all document libraries registered for that matter.
# Related links
DocLibCfg— defines the library templates- Doclib Set handler — apply full document library configuration