Knowledge Article Import
This skill activates when a practitioner needs to bulk-import Knowledge articles into Salesforce Lightning Knowledge using the native ZIP-based import mechanism. It covers ZIP package construction, CSV column requirements, the .properties control file, HTML asset embedding, the Draft-only landing status constraint, and the mandatory post-import bulk publish step.
Before Starting
Gather this context before working on anything in this domain:
- Lightning Knowledge must be enabled in the org (Setup > Knowledge Settings). Classic Knowledge and Lightning Knowledge use different import mechanisms — confirm which is active.
- Obtain the 18-character RecordTypeId for each article type. Articles imported without a valid RecordTypeId will fail.
- Data category groups and category API names must exist in the org before import. Categories are not created on the fly.
- The 20 MB ZIP file size limit is hard. Plan batch splitting for large content sets before building the package.
Core Concepts
ZIP Package Structure
The Salesforce Knowledge import mechanism accepts a single ZIP file (max 20 MB). The ZIP must contain:
- A CSV file — one row per article, defining metadata and mapping to content files.
- A
.properties file — a key-value control file specifying the article type, encoding, and optional folder paths.
- An optional
html/ folder — contains one HTML file per article when body content is stored externally rather than inline in the CSV.
- An optional
resources/ folder — contains images and other binary assets referenced from HTML files.
The .properties file must reference the CSV file name exactly. A mismatch in the filename causes the entire import to fail with a generic error.
CSV Column Format
The CSV controls every article field. Required and commonly used columns:
| Column |
Required |
Notes |
Title |
Yes |
Article title; cannot be blank |
URLName |
Yes |
Must be URL-safe, unique within the org, lowercase with hyphens |
RecordTypeId |
Yes |
18-character ID; determines article type |
IsMasterLanguage |
Yes |
true for the primary language version |
Language |
Yes |
BCP-47 code, e.g. en_US |
channels |
No |
One or more of: app, pkb, csp, prm separated by semicolons |
datacategorygroup__<GroupApiName> |
No |
One column per data category group; values are category API names delimited by + for multi-select |
Additional custom field columns follow the pattern <FieldApiName> exactly matching the API name on the article object. The HTML body column is <FieldApiName> pointing to a relative file path inside the html/ folder rather than inline content.
.properties Control File
The .properties file is a Java-style key-value file. Required keys:
ArticleType=<ArticleTypeApiName>
Encoding=UTF-8
CSVFile=<csv-filename>.csv
Optional keys include HTMLFolderPath (defaults to html) and ResourceFolderPath (defaults to resources). The ArticleType value must match the article record type API name (ending in __kav), not the label.
Draft-Only Landing Status
All articles imported via the ZIP mechanism land in Draft status regardless of any field value in the CSV. There is no publish-on-import option. After import completes, articles must be published separately.
Data Category Multi-Select Syntax
When an article belongs to multiple categories within the same group, values are +-delimited in the CSV cell: Hardware+Networking+Security. Do not use commas, semicolons, or spaces. A separate column is required per category group.
Common Patterns
Pattern 1: Single-Language Batch Import from External Help Center
When to use: Migrating a flat help center (single language, single article type) into Salesforce Knowledge in one pass.
How it works:
- Export source articles to HTML files, one per article.
- Build the CSV with one row per article; set
IsMasterLanguage=true, Language=en_US, populate RecordTypeId uniformly.
- Place HTML files in the
html/ folder; reference each by relative path in the body column.
- Create the
.properties file pointing to the CSV.
- ZIP all files keeping paths relative (no top-level folder wrapper).
- Import via Setup > Knowledge > Import Articles.
- After import, bulk-publish using a Knowledge list view filtered to Draft status.
Why not the alternative: Inline CSV body content (no html/ folder) breaks on articles with rich HTML, embedded images, or content over the CSV cell length limit. Always use the html/ folder for body content.
Pattern 2: Multi-Category Article Import with Data Category Assignment
When to use: Articles need to be assigned to multiple data categories at import time so that visibility rules apply immediately after publish.
How it works:
- For each data category group (e.g.
Products, Region), add a column named datacategorygroup__Products and datacategorygroup__Region to the CSV.
- In each cell, list the category API names joined by
+: Laptop+Desktop.
- Keep category API names lowercase and exactly matching the org's category API name — not the label.
- Import and validate that category assignments appear correctly in the imported drafts before bulk publishing.
Why not the alternative: Attempting to assign data categories after publish via list view is manual and does not scale. Getting categories right at import ensures visibility rules are correct from first publish.
Decision Guidance
| Situation |
Recommended Approach |
Reason |
| < 20 MB of content, single article type |
Single ZIP import via Setup UI |
Simplest; no API required |
| > 20 MB of content |
Split into multiple ZIP batches by article group or alphabet |
Hard platform limit; no workaround |
| Articles need to be published immediately after import |
Import first, then bulk-publish via list view or Knowledge API |
No publish-on-import option exists |
| Multilingual articles |
One CSV row per language version; set IsMasterLanguage=true on primary, false on translations |
Salesforce tracks language versions separately |
| Rich HTML with images |
Use html/ folder + resources/ folder; reference assets by relative path |
Inline image base64 encoding is not supported |
| Large-scale automation |
Use Salesforce CLI + Knowledge REST API for programmatic publish post-import |
UI bulk publish is capped at 200 per list view action |
Recommended Workflow
Step-by-step instructions for an AI agent or practitioner working on this task:
- Verify org prerequisites — Confirm Lightning Knowledge is enabled, at least one article record type exists, and data category groups are configured. Collect the RecordTypeId(s) and category API names needed.
- Prepare content — Export source articles to individual HTML files. Strip non-UTF-8 characters. Validate that image assets are available and can be placed in a
resources/ folder.
- Build the CSV — Create one row per article with all required columns:
Title, URLName, RecordTypeId, IsMasterLanguage, Language. Add channels and datacategorygroup__* columns as needed. Ensure URLName values are unique across the org.
- Create the .properties file — Set
ArticleType, Encoding=UTF-8, and CSVFile to match the CSV filename exactly. Confirm the ArticleType uses the API name (ending in __kav), not the label.
- Assemble and validate the ZIP — Package the CSV, .properties, html/ folder, and resources/ folder. Verify total ZIP size is under 20 MB. Test ZIP integrity locally before upload.
- Import via Setup — Navigate to Setup > Knowledge > Import Articles. Upload the ZIP, monitor import job status, and review the import log for per-row errors.
- Bulk publish imported drafts — Filter the Knowledge list view to Draft articles imported in this batch. Select all and publish. For batches over 200 articles, use the Knowledge REST API or iterate the list view in pages.
Review Checklist
Run through these before marking work in this area complete:
Salesforce-Specific Gotchas
Non-obvious platform behaviors that cause real production problems:
- All imported articles land in Draft — always — The import process ignores any publish-status field in the CSV. Every article arrives as a Draft regardless of source status. A separate bulk-publish step is mandatory. Forgetting this leaves all imported content invisible to end users.
- 20 MB ZIP limit is uncompressed content, not compressed — Salesforce measures the limit against the ZIP file size on disk, which is the compressed size. However, the practical limit is reached sooner than expected when HTML files contain embedded base64 images. Always use the resources/ folder for binary assets.
- URLName must be globally unique in the org — URLName collisions across article types cause individual row failures with a non-obvious error. Pre-check URLName uniqueness with a SOQL query on
KnowledgeArticle before import: SELECT UrlName FROM KnowledgeArticle.
- ArticleType in .properties must be the API name, not the label — The API name ends in
__kav. Using the display label (e.g., "FAQ" instead of "FAQ__kav") causes the entire import job to fail immediately with a misleading "invalid article type" message.
- Data category column header casing is case-sensitive — The column header
datacategorygroup__Products must match the group API name casing exactly. A mismatch silently skips category assignment without failing the row.
Output Artifacts
| Artifact |
Description |
| ZIP import package |
The assembled ZIP file ready for upload to Setup > Knowledge > Import Articles |
| CSV article manifest |
The CSV file documenting all article metadata, field values, and HTML file mappings |
| .properties control file |
The import control file specifying article type, encoding, and file paths |
| Post-import publish checklist |
Steps to bulk-publish Draft articles after import completes |
Related Skills
- data/bulk-api-and-large-data-loads — Use for large-scale programmatic Knowledge article operations beyond what the ZIP import supports
- data/data-migration-planning — Use to plan sequencing, rollback, and validation strategy before executing a large Knowledge migration
1---2name: knowledge-article-import3description: Use this skill when bulk-importing Knowledge articles into Salesforce from an external source using the ZIP-based import mechanism. Trigger keywords: knowledge import, article import, migrate help center, bulk upload articles, CSV article import, knowledge base migration. NOT for Knowledge admin setup (article types, data categories, permission sets), ongoing article management, or translation workflows once articles are live.4---56# Knowledge Article Import78This skill activates when a practitioner needs to bulk-import Knowledge articles into Salesforce Lightning Knowledge using the native ZIP-based import mechanism. It covers ZIP package construction, CSV column requirements, the .properties control file, HTML asset embedding, the Draft-only landing status constraint, and the mandatory post-import bulk publish step.910---1112## Before Starting1314Gather this context before working on anything in this domain:1516- Lightning Knowledge must be enabled in the org (Setup > Knowledge Settings). Classic Knowledge and Lightning Knowledge use different import mechanisms — confirm which is active.17- Obtain the 18-character RecordTypeId for each article type. Articles imported without a valid RecordTypeId will fail.18- Data category groups and category API names must exist in the org before import. Categories are not created on the fly.19- The 20 MB ZIP file size limit is hard. Plan batch splitting for large content sets before building the package.2021---2223## Core Concepts2425### ZIP Package Structure2627The Salesforce Knowledge import mechanism accepts a single ZIP file (max 20 MB). The ZIP must contain:28291. A CSV file — one row per article, defining metadata and mapping to content files.302. A `.properties` file — a key-value control file specifying the article type, encoding, and optional folder paths.313. An optional `html/` folder — contains one HTML file per article when body content is stored externally rather than inline in the CSV.324. An optional `resources/` folder — contains images and other binary assets referenced from HTML files.3334The `.properties` file must reference the CSV file name exactly. A mismatch in the filename causes the entire import to fail with a generic error.3536### CSV Column Format3738The CSV controls every article field. Required and commonly used columns:3940| Column | Required | Notes |41|---|---|---|42| `Title` | Yes | Article title; cannot be blank |43| `URLName` | Yes | Must be URL-safe, unique within the org, lowercase with hyphens |44| `RecordTypeId` | Yes | 18-character ID; determines article type |45| `IsMasterLanguage` | Yes | `true` for the primary language version |46| `Language` | Yes | BCP-47 code, e.g. `en_US` |47| `channels` | No | One or more of: `app`, `pkb`, `csp`, `prm` separated by semicolons |48| `datacategorygroup__<GroupApiName>` | No | One column per data category group; values are category API names delimited by `+` for multi-select |4950Additional custom field columns follow the pattern `<FieldApiName>` exactly matching the API name on the article object. The HTML body column is `<FieldApiName>` pointing to a relative file path inside the `html/` folder rather than inline content.5152### .properties Control File5354The `.properties` file is a Java-style key-value file. Required keys:5556```57ArticleType=<ArticleTypeApiName>58Encoding=UTF-859CSVFile=<csv-filename>.csv60```6162Optional keys include `HTMLFolderPath` (defaults to `html`) and `ResourceFolderPath` (defaults to `resources`). The `ArticleType` value must match the article record type API name (ending in `__kav`), not the label.6364### Draft-Only Landing Status6566All articles imported via the ZIP mechanism land in `Draft` status regardless of any field value in the CSV. There is no publish-on-import option. After import completes, articles must be published separately.6768### Data Category Multi-Select Syntax6970When an article belongs to multiple categories within the same group, values are `+`-delimited in the CSV cell: `Hardware+Networking+Security`. Do not use commas, semicolons, or spaces. A separate column is required per category group.7172---7374## Common Patterns7576### Pattern 1: Single-Language Batch Import from External Help Center7778**When to use:** Migrating a flat help center (single language, single article type) into Salesforce Knowledge in one pass.7980**How it works:**811. Export source articles to HTML files, one per article.822. Build the CSV with one row per article; set `IsMasterLanguage=true`, `Language=en_US`, populate `RecordTypeId` uniformly.833. Place HTML files in the `html/` folder; reference each by relative path in the body column.844. Create the `.properties` file pointing to the CSV.855. ZIP all files keeping paths relative (no top-level folder wrapper).866. Import via Setup > Knowledge > Import Articles.877. After import, bulk-publish using a Knowledge list view filtered to Draft status.8889**Why not the alternative:** Inline CSV body content (no html/ folder) breaks on articles with rich HTML, embedded images, or content over the CSV cell length limit. Always use the html/ folder for body content.9091### Pattern 2: Multi-Category Article Import with Data Category Assignment9293**When to use:** Articles need to be assigned to multiple data categories at import time so that visibility rules apply immediately after publish.9495**How it works:**961. For each data category group (e.g. `Products`, `Region`), add a column named `datacategorygroup__Products` and `datacategorygroup__Region` to the CSV.972. In each cell, list the category API names joined by `+`: `Laptop+Desktop`.983. Keep category API names lowercase and exactly matching the org's category API name — not the label.994. Import and validate that category assignments appear correctly in the imported drafts before bulk publishing.100101**Why not the alternative:** Attempting to assign data categories after publish via list view is manual and does not scale. Getting categories right at import ensures visibility rules are correct from first publish.102103---104105## Decision Guidance106107| Situation | Recommended Approach | Reason |108|---|---|---|109| < 20 MB of content, single article type | Single ZIP import via Setup UI | Simplest; no API required |110| > 20 MB of content | Split into multiple ZIP batches by article group or alphabet | Hard platform limit; no workaround |111| Articles need to be published immediately after import | Import first, then bulk-publish via list view or Knowledge API | No publish-on-import option exists |112| Multilingual articles | One CSV row per language version; set `IsMasterLanguage=true` on primary, `false` on translations | Salesforce tracks language versions separately |113| Rich HTML with images | Use html/ folder + resources/ folder; reference assets by relative path | Inline image base64 encoding is not supported |114| Large-scale automation | Use Salesforce CLI + Knowledge REST API for programmatic publish post-import | UI bulk publish is capped at 200 per list view action |115116---117118## Recommended Workflow119120Step-by-step instructions for an AI agent or practitioner working on this task:1211221. **Verify org prerequisites** — Confirm Lightning Knowledge is enabled, at least one article record type exists, and data category groups are configured. Collect the RecordTypeId(s) and category API names needed.1232. **Prepare content** — Export source articles to individual HTML files. Strip non-UTF-8 characters. Validate that image assets are available and can be placed in a `resources/` folder.1243. **Build the CSV** — Create one row per article with all required columns: `Title`, `URLName`, `RecordTypeId`, `IsMasterLanguage`, `Language`. Add `channels` and `datacategorygroup__*` columns as needed. Ensure `URLName` values are unique across the org.1254. **Create the .properties file** — Set `ArticleType`, `Encoding=UTF-8`, and `CSVFile` to match the CSV filename exactly. Confirm the `ArticleType` uses the API name (ending in `__kav`), not the label.1265. **Assemble and validate the ZIP** — Package the CSV, .properties, html/ folder, and resources/ folder. Verify total ZIP size is under 20 MB. Test ZIP integrity locally before upload.1276. **Import via Setup** — Navigate to Setup > Knowledge > Import Articles. Upload the ZIP, monitor import job status, and review the import log for per-row errors.1287. **Bulk publish imported drafts** — Filter the Knowledge list view to Draft articles imported in this batch. Select all and publish. For batches over 200 articles, use the Knowledge REST API or iterate the list view in pages.129130---131132## Review Checklist133134Run through these before marking work in this area complete:135136- [ ] `URLName` values are unique org-wide and contain no special characters beyond hyphens137- [ ] `RecordTypeId` is a valid 18-character ID pointing to an existing article record type138- [ ] Data category column names match group API names exactly (`datacategorygroup__GroupApiName`)139- [ ] Category values within a cell use `+` as delimiter, not commas or semicolons140- [ ] ZIP file is under 20 MB; if over, content has been split into multiple batches141- [ ] `.properties` file `CSVFile` value matches the actual CSV filename exactly142- [ ] `ArticleType` in .properties uses the API name (ending in `__kav`), not the label143- [ ] Import log reviewed and all rows processed without error144- [ ] Post-import bulk publish step completed; no articles left in Draft unintentionally145146---147148## Salesforce-Specific Gotchas149150Non-obvious platform behaviors that cause real production problems:1511521. **All imported articles land in Draft — always** — The import process ignores any publish-status field in the CSV. Every article arrives as a Draft regardless of source status. A separate bulk-publish step is mandatory. Forgetting this leaves all imported content invisible to end users.1532. **20 MB ZIP limit is uncompressed content, not compressed** — Salesforce measures the limit against the ZIP file size on disk, which is the compressed size. However, the practical limit is reached sooner than expected when HTML files contain embedded base64 images. Always use the resources/ folder for binary assets.1543. **URLName must be globally unique in the org** — URLName collisions across article types cause individual row failures with a non-obvious error. Pre-check URLName uniqueness with a SOQL query on `KnowledgeArticle` before import: `SELECT UrlName FROM KnowledgeArticle`.1554. **ArticleType in .properties must be the API name, not the label** — The API name ends in `__kav`. Using the display label (e.g., "FAQ" instead of "FAQ__kav") causes the entire import job to fail immediately with a misleading "invalid article type" message.1565. **Data category column header casing is case-sensitive** — The column header `datacategorygroup__Products` must match the group API name casing exactly. A mismatch silently skips category assignment without failing the row.157158---159160## Output Artifacts161162| Artifact | Description |163|---|---|164| ZIP import package | The assembled ZIP file ready for upload to Setup > Knowledge > Import Articles |165| CSV article manifest | The CSV file documenting all article metadata, field values, and HTML file mappings |166| .properties control file | The import control file specifying article type, encoding, and file paths |167| Post-import publish checklist | Steps to bulk-publish Draft articles after import completes |168169---170171## Related Skills172173- data/bulk-api-and-large-data-loads — Use for large-scale programmatic Knowledge article operations beyond what the ZIP import supports174- data/data-migration-planning — Use to plan sequencing, rollback, and validation strategy before executing a large Knowledge migration