Salesforce Knowledge Heroku Article Importer

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Import knowledge articles

Insert and Update

Requirements
 Knowledge articles enabled
 Chatter enabled
 KbApps package installed

Limits
 Maximum zip file size is 50mb
 Batch size:
◦ The default batch size is 50 records.
◦ Maximum batch size is 200 records.
◦ Maximum size of batch request is 50mb.
 .csv files can’t have more than 10,000 rows, including the header row. Therefore, you can
have a maximum of 9,999 articles and translations.

Creating a .csv File for Article Import

Each .csv file imports articles into one article type and maps the imported articles content with the article
type's fields. For example, a .csv file might map articles titles with the standard field Title in an article type,
meaning that each article's title is imported into the Title field.

1. Create one .csv file per article type.

 .csv files can have article translations only to update process, translations for an Insert are excluded.
 .cvs files must be comma separated values and each value wrapped with double quotes.

2. In the first row, specify the article type's fields and metadata (such as language data categories or
channels). Enter one item in each column. You can use the following fields and metadata to import content:

 Title—the article or translation’s title. Required only for insert process.


 UrlName—Required only for insert process. Represents the article's URL. Can contain
alphanumeric characters and hyphens but can't begin or end with a hyphen. UrlName is case-
sensitive and its maximum size is 255 characters.
 PublishStatus—Required. Refer to the status of the articles to import. All rows of the csv must have
the same PublishStatus.
 Standard or custom fields—refer to an article type's standard fields using field names and refer to
custom fields using API names. Leaving a row cell empty may cause your articles to be skipped if
the related article-type field is mandatory.
 isMasterLanguage—identify the article as a master (1) or translation (0). Required to update
translations (only Update).
 ArticleId—Required for Update, specify the articleId of the articles to update (only Update) .
 Language—specify article's language.
 Rich text area field—use the rich text area custom fields to import .html files or images. Refer to an
article type's rich text area field using its API name.
 File field—use the file custom fields to import any file type (.doc, .pdf, .txt, etc.). Refer to an article
type's file field using its API name.
 To categorize the imported articles, use category groups; refer to a category group using its unique
name prefixed with datacategorygroup. For example, use datacategorygroup.Products to specify the
category group Products.
 To specify where the imported articles are available, use the keyword Channels.

3. In subsequent rows, specify the articles you want to import. Use one row per article and enter the
appropriate information in each article type field column or metadata column.

 Standard or custom fields—enter the articles' data for each field, except for rich text area fields
where you must enter the relative path to the corresponding .html file in your .zip file.

 Rich text area field—always enter the .html file path relative to the location of the .csv file. Never
enter raw text. If the specified path doesn't exist, the related article is imported without Rich Text
Area field. Note the following information about importing HTML and images:
◦ We recommend that you create separate folders for the .html files (for example, /data) and the
images (for example, data/images).
◦ To import images, include the images in an .html file using the <img> tag and src attribute.
Ensure that the src value is a relative path from the .html file to the image folder.
◦ Images must be .png, .gif, or .jpeg files.
◦ Each image file can’t exceed 1 MB.
◦ .html files can’t exceed the maximum size for their field.
◦ If an .html file references a file that isn't allowed, the related article is imported without
insert/modify rich text area content.
◦ If an .html file references an image that's missing, the related article is imported without
insert/modify rich text area content.

 File field—enter the path relative to the file's location. If the specified path doesn't exist, the related
article is imported without file. Note the following information about importing files:
◦ We recommend that you create a folder for your files (for example, /files).
◦ Each file must not exceed 5 MB.

 Category groups—use category unique names to categorize articles. Use the plus symbol (+) to
specify more than one category. For example, Laptop+Desktop. Note the following information about
data category groups:
◦ Leaving the cell row empty on Insert process causes your article to be set to No Categories and
on Update process causes your article to doesn't update the category group.
◦ If you specify a category and its parent (for example, Europe+France) the import process take
the first value and all others values of the same level, and skip the values of the lower and higher
levels.
◦ The article translations have no associated data category\.

 Channels—specify articles' channels using the keywords:


◦ “application” for Internal App. If you don't specify a channel, “application” is the default.
◦ “sites” for Public Knowledge Base.
◦ “csp” for Customer.
◦ “prm” for Partner.
◦ Use the plus (+) symbol to specify more than one channel (for example, application+sites+csp to
make an article available in all channels).
◦ Translations doesn't have channels.

4. Create a .zip file containing:


 The .csv file.
 The folder containing the .html files to import.
 The folder containing the image files referenced in the .html files.
 The folder containing the attached files

The zip file must meet the following requirements:


 There can only be one .csv file.
 The .csv file must be in the root directory.
 The compression process must preserve the folder and subfolder structure.
 .csv files can’t have more than 10,000 rows, including the header row. Therefore, you can have a
maximum of 9,999 articles.

5. To complete the import:


 Upload your .zip file as a private chatter file.
 Go to Import tool.
 Login with salesforce credentials (User, password+security token).
 Select the appropriate Article Type.
 Select the uploaded .zip file.
 Select Insert/Update action.
 Click on submit button.

Actions by publish status

Draft Online Archived


Insert Only Master Articles Only Master Articles Only Master Articles
Update Master and Translations Master and Translations Only Master Articles

Csv example for update articles.

update.csv file:
"Title","Summary","UrlName","ArticleNumber","KnowledgeArticleId","PublishStatus","Channels","Language","IsMasterLanguage","Rich_Text_Area__c","File__c","datacategorygroup.Products"
"Free Digital Camera Offer","Get the new Digital Camera","URL-Name-1","83363","kA7E0000000LCLsKAO","Draft","application","en_US","1","data/
kA7E0000000LCLsKAO_RTA_1.html","files/kA7E0000000LCLsKAO_File_1.txt","Laptops+Desktops"
"Libérer l'Offre d'Appareil photo digital","Obtenir le nouvel Appareil photo digital.","URL-Name-1","83363","kA7E0000000LCLsKAO","Draft","","fr","0","data/freecam/fr.html","files/
kA7E0000000LCLsKAO_Fr_File_1.txt",""
"Best Desktop Computer Deals","","URL-Name-2","83470","kA7E0000000LCNbKAO","Draft","application+csp","en_US","1","data/bestdeals.html","files/
kA7E0000000LCNbKAO_RTA_1.pdf","Desktops"
"Meilleures Affaires d'ordinateurs de bureau","","URL-Name-2","83470","kA7E0000000LCNbKAO","Draft","","fr","0","data/bestdeals/fr.html","",""

Title Summ UrlNa Articl Knowle Publi Chann Langu IsMast Rich_T File__ datacateg
ary me e dge sh els age er ext_Are c orygroup.
Num ArticleI Statu Langu a__c Products
ber d s age
files/
Get data/ kA7E0
Free the kA7E00 kA7E00 00000
URL- Laptops+D
Digital new 00000L applica 00000L 0LCLs
Name- 83363 Draft en_US 1 esktops
Camer Digital CLsKA tion CLsKA KAO_
1
a Offer Camer O O_RTA File_1.
a _1.html txt

Libérer Obteni URL- 83363 kA7E00 Draft fr 0 data/ files/


l'Offre r le Name- 00000L freecam kA7E0
d'Appar nouvel 1 CLsKA /fr.html 00000
eil Appare O 0LCLs
photo il photo KAO_
digital digital. Fr_File
_1.txt
files/
Best kA7E0
kA7E00
Deskto 00000
URL- 00000L applica data/
p 0LCNb Desktops
Name- 83470 CNbKA Draft tion+cs en_US 1 bestdeal
Compu KAO_
2 O p s.html
ter RTA_1
Deals .pdf

Meilleu
res
kA7E00 data/
Affaires URL-
83470 00000L bestdeal
d'ordin Name- Draft fr 0
CNbKA s/fr.html
ateurs 2
O
de
bureau

Csv example for insert articles.

insert.csv file:

"Title","Summary","UrlName","PublishStatus","Channels","Language","IsMasterLanguage","Rich_Text_Area__c","File__c","datacategorygroup.Products"
"Free Digital Camera Offer","Get the new Digital Camera","URL-Name-1","Draft","application","en_US","1","data/kA7E0000000LCLsKAO_RTA_1.html","files/
kA7E0000000LCLsKAO_File_1.txt","Laptops+Desktops"
"Best Desktop Computer Deals","","URL-Name-2","Draft","application+csp","en_US","1","data/bestdeals.html","files/kA7E0000000LCNbKAO_RTA_1.pdf","Desktops"

Title Summar UrlNam Publi Channel Langua IsMaste Rich_Text_Ar File__c datacateg
y e sh s ge r ea__c orygroup.
Statu Langua Products
s ge
files/
kA7E00
Free Get the data/
00000L Laptops+D
Digital new URL- applicatio kA7E0000000
Draft en_US 1 CLsKA esktops
Camera Digital Name-1 n LCLsKAO_RT
O_File_
Offer Camera A_1.html
1.txt

files/
kA7E00
Best
00000L
Desktop URL- applicatio data/
Draft en_US 1 CNbKA Desktops
Computer Name-2 n+csp bestdeals.html
O_RTA
Deals
_1.pdf

You might also like