AX2440
Import Wizard: Variables tab
In the Variables tab of the Import Wizard, you can define variables to be used in the import. Import variables can be used in the following import settings:
- Source and destination columns (Mapping tab)
- Destination table (Mapping tab)
- Transform statements or functions (Transforms tab)
- SQL SELECT statement to the source table (Source tab)
- Source file (Source tab)
- Sheet name (Source tab)
When the import is executed, before any import steps are processed, Axiom Software checks the Variables tab for variables. If variables are defined (regardless of whether they are used in the import), the Variables dialog is presented to the user. Once the user has specified a value for each variable, the import begins processing.
For example, you might have database tables that have the year incorporated into the table name. You could define a variable for year, and configure the destination table to use the variable. Data would then be imported into the appropriate table, depending upon the year selected by the user.
To use a variable in the import, enter the variable name into one of the supported areas of the import settings, enclosed in curly brackets {}. For example, if the variable name is "mycolumn", you would enter {mycolumn}
.
NOTE: If the variable defines the destination table, then you must place the variable in double curly brackets when you use it in a SQL statement, so that the eventual table name value is enclosed in curly brackets as expected. For example, if you have a variable named "destinationtable", you would reference that variable as {{destinationtable}}
. That way, when the {destinationtable}
value is defined, it will resolve as {GL2019}
.
Managing import variables
This tab has two sections. In the top section, you can create user-defined variables for the import. The bottom section displays the built-in system variables that can be used in the import. This Built-in Variables section is for reference only, so that you can see the variables available for use.
-
To add a variable, click Add variable
. The new variable row is added below the row that is currently selected.
-
To edit a variable, type the changes into the grid.
If you change the name of a variable, you must update any references to that variable in the import to use the new name.
-
To delete a variable, select the row that you want to delete and then click Remove variable
.
Make sure the variable is not used in the import before deleting it. If the import references a variable that is not defined, an error will result when executing the import.
The following settings are defined for variables:
Item | Description |
---|---|
Prompt for value even if variable only contains one choice |
This setting applies to all defined variables for the import, and determines the system behavior when a variable has only one choice.
|
Name |
The name of the variable. Import variable names cannot use the same name as transform variable names, and vice versa. Every variable name within the import must be unique. NOTE: Import variables cannot use the same names as tables defined in your system. This is because the syntax for referencing tables is the same as the syntax for referencing variables. A validation message will display in the Import Wizard if a variable name matches a table name. If a table is later created with the same name as an existing variable, then subsequent executions of the import will fail with an error identifying the table name / variable name duplication. |
Choices |
The set of valid choices for the variable, separated by semi-colons. You can leave the choices blank if there is not a defined set of values for the variable. When the import is executed, the user can type in a value for the variable (if Allow Free Input is enabled). Variables (user-defined or system variables) can also be used as choices. Note that variables used as choices will not be resolved to values in the Variables dialog that is presented to the user when the import is run interactively. However, the variable will be resolved during the import execution. You can also specify a column or columns in the database by entering fully qualified Table.Column syntax. The user will be presented with a drop-down list of all values (up to 500) in the specified column. For example, enter DEPT.Region if you want the user to select from the list of regions in the DEPT table. You can specify multiple database columns, separated by semi-colons. For example, DEPT.VP; DEPT.Mgr. The column values will be collected into a single list. |
Description |
Optional description text that displays in the Variables dialog. This dialog displays when the import is executed, to prompt the user to specify a value for the variable. Description text displays as follows above the variable selection drop-down list: VariableName:DescriptionText |
Allow Free Input |
Specifies whether users can type in their own values for the variable, or if they are restricted to the list of choices.
|