{"id":28284,"date":"2026-04-16T14:36:35","date_gmt":"2026-04-16T12:36:35","guid":{"rendered":"https:\/\/support.serviceprotokoll.se\/kb\/import-agreement-from-excel\/"},"modified":"2026-05-26T11:41:57","modified_gmt":"2026-05-26T09:41:57","slug":"import-agreement-from-excel","status":"publish","type":"ht_kb","link":"https:\/\/support.serviceprotokoll.se\/en\/kb\/import-agreement-from-excel\/","title":{"rendered":"Import agreement from Excel"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Preparation of the Excel file<\/h3>\n\n<h4 class=\"wp-block-heading\"><strong>General structure<\/strong><\/h4>\n\n<p class=\"wp-block-paragraph\">The Excel file must have:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>a header line first<\/li>\n\n\n\n<li>then one line per contract line\/price line<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">The same agreement can appear on several lines in the file. The importer then merges these into an agreement and puts the respective price line in the correct list.<\/p>\n\n<h4 class=\"wp-block-heading\"><strong>Column headings and accepted names<\/strong><\/h4>\n\n<p class=\"wp-block-paragraph\">The headings are not case sensitive and can be in Swedish or English.<\/p>\n\n<p class=\"wp-block-paragraph\">The import recognizes both:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>headers from external file structure<\/li>\n\n\n\n<li>internal\/native propname*<\/li>\n\n\n\n<li>Swedish and English versions<\/li>\n<\/ul>\n\n<h4 class=\"wp-block-heading\"><strong>1. Identification and Update<\/strong><\/h4>\n\n<p class=\"wp-block-paragraph\">The import primarily uses the following logic to find the right agreement:<\/p>\n\n<ol class=\"wp-block-list\">\n<li><strong>Serial number \/ contract number<\/strong> if it is in the file<\/li>\n\n\n\n<li>otherwise <strong>OrderNo + customer number<\/strong> if there is one and an agreement already exists in the group<\/li>\n\n\n\n<li>otherwise a <strong>new agreement<\/strong> is created<\/li>\n<\/ol>\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th><strong>Accepted headlines<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>agreement number \/ identity<\/strong><\/td><td>serial<br\/>serialnumber<br\/>agreementnumber<br\/>agreementno<br\/>avtalsnummer<br\/>avtalnr<br\/>project<br\/>projekt<\/td><\/tr><tr><td><strong>external order-\/project number<\/strong><\/td><td>orderno<br\/>ordernumber<br\/>ordernr<br\/>orderno.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n<p class=\"wp-block-paragraph\">If the file is completely missing an agreement number, the import will still work. Then the rows are first grouped together into the correct agreement within the file, and the import then creates new agreements.<\/p>\n\n<h4 class=\"wp-block-heading\"><strong>2. Agreement field<\/strong><\/h4>\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Agreement field<\/strong><\/th><th><strong>Accepted headlines<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>Agreement name<\/strong><\/td><td>name<br\/>agreementname<br\/>description<br\/><br\/><strong>Note:<\/strong> In some external files, Description is used twice. Then interpreted:<br\/>first Description as contract name<br\/>other Description as the price row description<\/td><\/tr><tr><td><strong>Customer number<\/strong><\/td><td>customerid<br\/>customerno<\/td><\/tr><tr><td><strong>Customer name<\/strong><\/td><td>customer<br\/>customername<\/td><\/tr><tr><td><strong>Facility<\/strong><\/td><td>facility<br\/>facilityname<\/td><\/tr><tr><td><strong>Start date<\/strong><\/td><td>fromdate<br\/>start<br\/>startdate<\/td><\/tr><tr><td><strong>End date<\/strong><\/td><td>end<br\/>enddate<br\/>agreementend<br\/>agreementenddate<\/td><\/tr><tr><td><strong>Created date<\/strong><\/td><td>creationdate<br\/>created<\/td><\/tr><tr><td><strong>Cost center<\/strong><\/td><td>costcenter<\/td><\/tr><tr><td><strong>Agreement type<\/strong><\/td><td>type<br\/>agreementtype<br\/>avtalstyp<br\/>fakttyp<br\/>fakttypt<\/td><\/tr><tr><td><strong>Invoicing frequency \/ interval per month<\/strong><\/td><td>invoicingperiodmonths<br\/>invoicefrequency<br\/><br\/>Supported values \u200b\u200bfor invoicing frequency:<br\/>1, m, month, monthly \u2192 <strong>1 month<\/strong><br\/>3, kv, quarter, quarterly \u2192 <strong>3 month<\/strong><br\/>6, halfyear, semiannual \u2192 <strong>6 month<\/strong><br\/>12, year, yearly, annual \u2192 <strong>12 month<\/strong><\/td><\/tr><tr><td><strong>Autogenerate invoice<\/strong><\/td><td>autogenerateinvoice<br\/>autofaktura<br\/>autogenererafaktura<\/td><\/tr><tr><td><strong>Financially settled<\/strong><\/td><td>financiallysettle<br\/>financialsettle<br\/>slutreglera<br\/>slutregleras<\/td><\/tr><\/tbody><\/table><\/figure>\n\n<p class=\"wp-block-paragraph\"><strong>3. Price row<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">The import can read both <strong>invoiced lines<\/strong> and <strong>included lines<\/strong> in the same file.<\/p>\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Price row<\/strong><\/th><th><strong>Accepted headlines<\/strong><\/th><\/tr><\/thead><tbody><tr><td><\/td><td><\/td><\/tr><tr><td><strong>Price row type<\/strong><\/td><td>rowtype<br\/>articlelist<br\/>includedorinvoiced<br\/>target<br\/>rowtarget<br\/>radtyp<br\/><br\/><strong>Supported values:<\/strong><br\/>included<br\/>\u2192 the line is imported to <strong>Included<\/strong><br\/><br\/><strong>Supported values:<\/strong><br\/>invoiced<br\/>fakturerad<br\/>fakturerat<br\/><br\/>\u2192 the line is imported into Invoiced<br\/>If the column is missing or the value is not recognised, the row ends up in Invoiced.<\/td><\/tr><tr><td><strong>Row number<\/strong><\/td><td>linenumber<br\/>line<br\/>row<\/td><\/tr><tr><td><strong>Article number<\/strong><\/td><td>artno<br\/>article<br\/>articleno<br\/>articleid<\/td><\/tr><tr><td><strong>Price row description<\/strong><\/td><td>desc<br\/>species desc<br\/>item description<br\/>Additionally, other occurrences of Description in some external files may be interpreted as price line description.<\/td><\/tr><tr><td><strong>Amount<\/strong><\/td><td>amount<br\/>number<br\/><br\/>If number is missing or is 0, 1 is used.<\/td><\/tr><tr><td><strong>Unit<\/strong><\/td><td>unit<br\/>enhet<\/td><\/tr><tr><td><strong>Price \/ gross price \/ sum<\/strong><\/td><td>grossprice<br\/>price<\/td><\/tr><tr><td><strong>Discount<\/strong><\/td><td>discount<br\/>rabatt<\/td><\/tr><tr><td><strong>External counter<\/strong><\/td><td>externalcounter<br\/>counter<br\/>externteller<\/td><\/tr><tr><td><strong>External counter value<\/strong><\/td><td>externalcountervalue<br\/>countervalue<\/td><\/tr><\/tbody><\/table><\/figure>\n\n<p class=\"wp-block-paragraph\"><strong>4. Custom field<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">Columns that are not recognized as standard fields are interpreted as custom fields.<\/p>\n\n<p class=\"wp-block-paragraph\">In order for a self-defined field to be saved as a true self-defined contract field, the corresponding field must already be set up in the group&#8217;s <em>Agreement Settings.<\/em> If the field is <strong>not<\/strong> set up in the settings, the value is instead added to the agreement&#8217;s description during import.<\/p>\n\n<h4 class=\"wp-block-heading\">Data format and values<\/h4>\n\n<p class=\"wp-block-paragraph\">Dates must be valid dates, boolean values \u200b\u200bmust be clear, and numeric fields must contain numbers.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>Date<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">Preferably use:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>YYYY-MM-DD<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">Other valid date formats may also work, but the recommendation is to use a clear date format such as YYYY-MM-DD.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>Boolean value<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">The following is interpreted as <strong>true:<\/strong><\/p>\n\n<ul class=\"wp-block-list\">\n<li>true<\/li>\n\n\n\n<li>1<\/li>\n\n\n\n<li>yes<\/li>\n\n\n\n<li>y<\/li>\n\n\n\n<li>ja<\/li>\n\n\n\n<li>j<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">Empty or other values \u200b\u200bare interpreted as false.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>Numeric values<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">For numeric columns such as:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>amount<\/li>\n\n\n\n<li>price<\/li>\n\n\n\n<li>discount<\/li>\n\n\n\n<li>counter value<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">you should only use numeric values.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>Missing number of articles<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">If quantity is not specified on a price line, 1 is used.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>When an agreement is updated<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">The importer first tries to find an existing agreement by:<\/p>\n\n<ol class=\"wp-block-list\">\n<li><strong>SerialNumber<\/strong><\/li>\n\n\n\n<li>otherwise <strong>OrderNo + customer number<\/strong><\/li>\n<\/ol>\n\n<p class=\"wp-block-paragraph\">If an agreement is found, it is updated with new values.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>When a new agreement is created<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">If no matching agreement is found, a new agreement is created.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>When the contract number is missing<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">If the contract number is missing in the file:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>the rows are still grouped together into the correct agreement within the same file<\/li>\n\n\n\n<li>a new serial number is created internally for the import<\/li>\n\n\n\n<li>the same file can therefore be imported correctly even without a serial number<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\"><strong>Mixed price line types<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">If the file contains both:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>Included<\/li>\n\n\n\n<li>Invoiced<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">the rows will end up in the correct list per row.<\/p>\n\n<p class=\"wp-block-paragraph\">If line type is missing, the line goes to Invoiced.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>Duplicate handling for price lines<\/strong><\/p>\n\n<p class=\"wp-block-paragraph\">The import tries to avoid duplicates by comparing:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>rownumber<\/li>\n\n\n\n<li>articlenumber<\/li>\n\n\n\n<li>description<\/li>\n\n\n\n<li>amount<\/li>\n\n\n\n<li>price<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">If the same row is found, it is updated instead of added again.<\/p>\n\n<h4 class=\"wp-block-heading\">Why didn&#8217;t the agreement come through?<\/h4>\n\n<p class=\"wp-block-paragraph\">Common causes are:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>no useful contract or line content on the line<\/li>\n\n\n\n<li>invalid date format<\/li>\n\n\n\n<li>numeric fields contain text<\/li>\n\n\n\n<li>customer cannot be matched against the customer register<\/li>\n\n\n\n<li>typos in headings so the field is not recognised<\/li>\n\n\n\n<li>the agreement contains self-created fields that are not set up in the agreement settings<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\"><a class=\"heroickb_exit_link\" href=\"?hkb-redirect&#038;nonce=32f804a84b&#038;check=64kke&#038;redirect=https%3A%2F%2Fsupport.serviceprotokoll.se%2Fen%2Fkb%2Fexample-on-excel-file-and-faq-agreement%2F&#038;otype=unknown&#038;oid=0&#038;source=block-content\" data-type=\"ht_kb\" data-id=\"27913\">Example Excel files<\/a><\/p>\n\n<p class=\"wp-block-paragraph\"><a class=\"heroickb_exit_link\" href=\"?hkb-redirect&#038;nonce=32f804a84b&#038;check=6fjqv&#038;redirect=https%3A%2F%2Fsupport.serviceprotokoll.se%2Fen%2Fkb%2Fexample-on-excel-file-and-faq-agreement%2F%23vanliga-fragor&#038;otype=unknown&#038;oid=0&#038;source=block-content\">FAQ<\/a><\/p>\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n<p class=\"wp-block-paragraph\">*native-import means directly importing a file exported from the system<\/p>\n\n<p class=\"wp-block-paragraph\">Testing <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Preparation of the Excel file General structure The Excel file must have: The same agreement can appear on several lines in the file. The importer then merges these into an agreement and puts the respective price line in the correct list. Column headings and accepted names The headings are not&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_searchwp_excluded":"","footnotes":""},"ht-kb-category":[1003],"ht-kb-tag":[1018],"class_list":["post-28284","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-upload-records","ht_kb_tag-import-agreement"],"_links":{"self":[{"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/ht-kb\/28284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/comments?post=28284"}],"version-history":[{"count":1,"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/ht-kb\/28284\/revisions"}],"predecessor-version":[{"id":28285,"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/ht-kb\/28284\/revisions\/28285"}],"wp:attachment":[{"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/media?parent=28284"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/ht-kb-category?post=28284"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/support.serviceprotokoll.se\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=28284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}