# How to create Template database

**Description**

I have installed SWING Integrator to a Lotus Notes database.&#x20;

I want to be able to grab template documents from another database.  What do I need to do to make that database  source of template documents?&#x20;

**Solution**

What you need to do is set SW\_TemplateDbServer and SW\_TemplateDbFilePath globals in the Document databases to point to the Template database (storage) on the server. You should set these variables for every database you need to get Templates for. You will find them in the "SW\_IntOfficeMsg" script library.

Below is the description what you need to set to have proper template selection:

**Template database**:

which will have stored Template setup documents on the server in data directory.

In that database you should set globals:

SW\_TemplateDbServer = ""                 &#x20;

SW\_TemplateDbFilePath = "”

No need for grabbing the templates for this database. So, just leave those two clear:

Point to document database (the one that will provide you with the forms to map the fields). This could be a mail database on server as this is used only for selecting forms and fields from it so ti actually correspondent with same forms and fields in users mail databases.

SW\_DocumentsDbServer="" 'Use in templates database to point to document database server

SW\_DocumentsDbFilePath = ""     &#x20;

'Use in templates database to point to documents database

**Document database(s)**

You need to set server and path to the Template database from where it will select templates

SW\_TemplateDbServer = ""   'Use in documents database to point to templates database server

SW\_TemplateDbFilePath = ""  &#x20;

'Use in documents database to point to templates database, relative to data directory (e.g. "IntOffice\MyTemplates.nsf")

' These globals stays clean as you do not need another document database

SW\_DocumentsDbServer = ""             &#x20;

SW\_DocumentsDbFilePath = ""

If you need to create Template setup document you need to set Document database path in the Template database (those variables could be changed programatically).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swingsoftware.com/integrator-for-notes/how-to/how-to-create-template-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
