edoc invoice Administration Guide
Breadcrumbs

Create a new query for the master data import

To be able to query the master data, you have already created the connection between the source system, e.g. an SQL database, and the destination system (edoc invoice).

Master data usually includes all details on vendors, e.g. their address, bank details, packing slips, purchase order items, payment terms and the VAT rate. In addition, you can also query users or user groups who assume certain responsibilities in the context of invoice verification, e.g. cost center managers.

To be able to use the master data in edoc invoice, create an SQL query or a REST API query for each data object (e.g. address data for vendors, purchase order numbers).

Here's how

  1. Click on edoc invoice in the sidebar to open the edoc invoice dashboard.

  2. Click on Settings and select the relevant company under Company settings.

  3. Click on Data > Import - Master data in the sidebar.

  4. Click on New query in the ribbon.

  5. Under Settings, specify the following:

    1. Connection type: Select the connection type that you have specified for the source system under Connections > Connection details.

    2. Destination object: Select the data object you want to query, e.g. vendors or purchase order numbers.

    3. Name: The name of the destination object is entered automatically. You can change the name as required.

    4. Visible (all companies): Activate this option to also use the connection for all other companies. By default, you only configure a connection for the selected company.

Once you have selected the connection type and the destination object, further details are available to refine your query.

  • The existing variables for your query are displayed in the Placeholder section. You can use these placeholders in your query. By default, the placeholders clientName, clientFinanceId and clientId are available. If you define placeholders enclosed in dollar signs ($) in your query, the placeholders from the code are entered in the table.

  • In the Mappings section, you will find the fields of the destination object in the order of the query. You can change the order using drag and drop or remove fields.

  • In the Test connection section, you can select the connection you want to test. Click on Test query in the ribbon.

  • In the Test placeholder section, you can see the placeholders that you are testing with the selected connection.

  • You will receive the result of your query in the Test log section.

SQL database as connection type

If you have selected an SQL database as the connection type, add your SQL query in the SQL query section.

Your SQL query must match the order of the fields of the destination object in the Mappings section. If the order does not match, the import may result in incorrect data.

If you are satisfied with the result, click on Save. You can change your saved query at any time by clicking on Edit query for the saved query under Data > Import - Master data.

"REST Api" as connection type

The endpoint you use must return either an OData-compliant response or a response in JSON format as an array of objects without additional metadata.

The following OData versions and data formats are supported when importing master data with the REST Api connection type:

  • OData v2: JSON and XML

  • OData v4: JSON

Which OData version and which data format the REST API endpoint delivers is automatically recognized based on the response from the endpoint.

Your REST API query must match the order of the fields of the destination object in the Mappings section. If the order does not match, the import may result in incorrect data.

If you have selected REST Api as the connection type, enter the following:

  • In the REST method section, select the corresponding function under Method and enter the corresponding endpoint under Endpoint. The endpoint is the URL under which your service can be reached.

  • In the REST header section, enter a name and the value of the query. Instructions for defining the headers can be found in the HTTP documentation from Mozilla (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). You can also define your own headers at any time, provided the REST API supports this.

  • In the REST body (JSON) section, insert the corresponding JSON object for the endpoint. If the endpoint does not expect a JSON object, you can leave this section empty. Help and examples for handling JSON objects can be found in the JSON documentation from Mozilla (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON).


See also