Create index files with docXporter

Prev Next
This content is currently unavailable in French. You are viewing the default (English) version.

In addition to exporting documents from DocuWare, you may create index files with docXporter. This function is particularly important when transferring documents and other information to ERP or CRM systems.

There is no standard for the format and characteristics in which such index files are created and processed. There is no "one" type of index file, but the format and structure differ, sometimes significantly, between the individual target systems.

With the Scriban template engine, docXporter creates almost any type of index file: CSV files and XML files are no problem.

Create templates

The template engine is based on Scriban. Use the manual on the GitHub project page as a reference: https://github.com/scriban/scriban/tree/master/doc

Find several template in the folder C:\ProgramData\docXporter\Templates. Use them as a basis for your own templates. Templates should have the file extension .sbntxt. Make a copy of one of the templates for your own purposes.

We recommend Visual Studio Code and the associated Scriban extension for syntax highlighting when editing the editor.

Access to index fields

Index fields are available as variables. The DocuWare database name is used as the name in capital letters.

All information between curly brackets {{ statements between brackets }} is interpreted by the template engine. All other texts outside the brackets are static and remain unchanged.

Abridged excerpt from the DATEV REWE template:

{{-date.now | date.to_string "%Y%m%d%H%M%S"-}};;"DocXporter";"admin";"";"{{-BERATER-}}";

The content of the BERATER field is displayed on the right. When used between static text outputs, the field name is specified in the format {{-BERATER-}}.

The current date and time are displayed on the left.

Access to table fields

Table fields are accessed in the same way. The SPLITBUCHUNG table field is also available as a variable. A loop can be used to iterate over the rows. The values in the individual columns are then accessed via row.DBNAME.

Abridged excerpt from the DATEV REWE template:

{{~ for row in SPLITBUCHUNG ~}}
{{- row.SPLIT_ERPEXPORT_BETRAG -}};{{- row.SPLIT_SOLLHABEN -}};"{{- W_HRUNG -}}";;;"";"{{- row.SPLIT_KONTO | get_value -}}";"{{-FIRMENKONTO-}}";
{{~ end # for of Table-Field ~}}
  • The example starts with a for loop. This causes the template engine to iterate over each row (variable row) in the table field SPLITBUCHUNG

  • A column / field is accessed via row.DBNAME. Here, for example, {{- row.SPLIT_ERPEXPORT_BETRAG -}}

  • Of course, the other index fields can also be accessed within the loop: {{-COMPANY-ACCOUNT-}}

  • The loop is terminated in the last line with end. The output between for..end is written to the target index file for as long as there are lines in the table field.

  • The line {{- row.SPLIT_KONTO | get_value -}} is striking. Here the value SPLIT_KONTO is processed in a get_value function. In this particular case, the purpose of this is to output only the account number (4711) and not the actual value from the index field (4711>General example).