Environment variable is a string that is used to store some text, such as a path to an external resource. Environment variables are specified in the properties of a project (Project → Project Properties → Environment Variables) and are used in Document Definitions and scripts.
When a project is run on another Application Server or on another computer, the paths to the external resources may change.
If the project includes several Document Definitions, multiple database check rules, and several scripts, editing all of these objects may take quite some time.
To avoid editing all the objects used by the project, you can specify the paths to the external objects in environment variables and use these variables when creating rules, setting up export or writing scripts. Now if you run your project in a different environment, you will simply need to edit the connection parameters in the Environment Variables dialog box.
Types of environment variable
There are two types of environment variable in ABBYY FlexiCapture:
- String This is a text variable.
- ADO connection string This a string used to connect to an ODBC-compatible database.
Creating and editing environment variables
To create a new environment variable:
- In the Project Properties dialog box, click the Environment Variables tab and then click the New... button.
- In the New Environment Variable dialog box, select a type and enter a name for the environment variable. You will not be able to change the type of the environment variable later.
- Complete the Value field depending on the type of your environment variable:
- For an environment variable of type String, enter a value (e.g. the path to a folder or e-mail address).
- For an environment variable of type ADO connection string, specify the path to the database, the access parameters, and any other connection parameters required by the driver that you use.
To edit or delete an existing environment variable, click Edit... or Delete.
Using environment variables
- Environment variables of the String type can be used to:
- specify a source of input images;
- specify settings that determine how documents are exported to files and images.
Use the following syntax to call an environment variable: <Env:Name_of_environment_variable> or <$:Name_of_environment_variable>.
- Environment variables of type ADO connection string can be used to connect to various databases:
- When creating a database check rule
- In a Document Definition when setting up export
- In a Document Definition when connecting a data set to an external database
- In field properties, when specifying value constraints
- Environment variables of any type can be used in scripts. Use the EnviromentVariables property of IProperties, which is available in the IProject interface.
5/25/2023 7:55:02 AM