AX1026

Managing file group variables using Save Type 4

Using Save Type 4, you can create, edit, or delete file group variables by using save-to-database within a spreadsheet, instead of using the Edit File Group dialog. This may be a more convenient approach when you want to impact many variables at one time, or when you want to automate the process.

Save Type 4 depends on the placement of save-to-database tags within the sheet. There are three components:

  • The primary SaveStructure2DB tag, which defines the locations of the save-to-database control row and control column, and specifies the system table that you want to update.
  • Column tags in the save-to-database control row, to specify the columns holding the variable properties.
  • Row tags in the save-to-database control column, to specify the rows to include in the save process and to determine the action to take on the variable.
Save-to-database tag summary
Tag Type Tag Syntax

Primary tag

[SaveStructure2DB; Axiom.FileGroupVariables; CustomSaveTag=Name]

Row tags

[Save]

[Delete]

Column tags

FileGroupID

Name

RawValue

Category

ReadOnly

DataType

NOTES:  

  • Save Type 4 must be enabled for the sheet on the file's Control Sheet in order for the save process to occur. For more information, see Using Save Type 4.
  • The user performing the save must be an administrator or have one of the following security permissions: Administer File Groups (for all file groups) or Modify File Group (for specific file groups).
  • The built-in file group variables such as FileGroupYear cannot be modified using Save Type 4.

Placing the primary save-to-database tag in the sheet

To define the save-to-database process, place the following tag in any cell in the sheet, within the first 500 rows:

[SaveStructure2DB;Axiom.FileGroupVariables]

The row containing this tag becomes the control row for the process, and the column containing this tag becomes the control column for the process.

You can also optionally use the custom save tag parameter. For example:

[SaveStructure2DB;Axiom.FileGroupVariables;CustomSaveTag=SaveVariable]

NOTES:  

  • The primary SaveStructure2DB tag must be located in the first 500 rows of the sheet.

  • The SaveStructure2DB tag can be placed within a formula, as long as the starting bracket and identifying tag are present as a whole within the formula. For more information, see Using formulas with Axiom feature tags.

Placing the variable property tags in the control row

Within the control row for the save-to-database process, specify the columns that define the variable properties. These properties can be placed in any column:

Column Tag Description

FileGroupID

The database ID of the file group.

Name

The name of the variable.

RawValue

The variable value.

Category

The variable category. Use Generic, TableName, or Picklist. "Generic" refers to non-table variables defined on the General Variables tab.

ReadOnly

Whether the table the variable resolves to is read-only for the file group (True/False). Only applies if the category is TableName.

DataType

The variable data type. Use either String or Numeric. This field is only configurable for generic (general) variables. All other variable types are always String.

When editing an existing general variable, you can change a Numeric variable to String, but you cannot change a String variable to Numeric.

The column tags can be placed to either the right or the left of the SaveStructure2DB tag. FileGroupID, Name, and Category are required.

The control row must be dedicated to containing only valid column names for the Save Type 4 operation to the target table. Any invalid entries in the control row will cause an error when saving.

NOTE: It is not possible to configure the optional properties of picklist variables using Save Type 4. These properties can only be modified in the Edit File Group dialog.

Flagging the rows to save or delete

Within the control column for the save-to-database process, mark each row that you want to be processed with the appropriate row tag:

Row Tag Description

[Save]

Creates or updates the variable with the properties specified in the spreadsheet.

NOTE: If you have defined a custom save tag in the SaveStructure2DB tag, then you must mark the rows with that tag instead of the default tag. For example, if your primary tag is [SaveStructure2DB; Axiom.FileGroupVariables; CustomSaveTag=SaveVariable] then you would place the tag [SaveVariable] in the rows that you wanted to be saved.

[Delete]

Deletes the variable, based on the specified name.

Only rows that are marked with a valid tag are processed; all other rows are ignored, even if there is content in the property columns. If a row contains a valid tag but no content exists in the property columns, a save error will occur.

When the save-to-database occurs, delete actions are processed first, followed by save actions.

NOTE: The row tag can be placed within a formula if desired. For example, you might want to use a formula to determine whether a particular row should be saved or deleted.

Populating the variable properties in the spreadsheet

You can manually type the variable properties within the spreadsheet, or you can use an Axiom query to populate the spreadsheet with the variables that are currently defined in the database. Once you have the current list of variables as a starting point, you can adjust them as necessary, and then save the changes back to the database.

For example, imagine that you want to update variables for the 2020 Budget file group. You can:

  • Create an Axiom query to bring in the current variables for that file group, by querying Axiom.FileGroupVariables and filtering the results to just that file group.
  • Set up the save-to-database tags so that the fields to be saved line up with the information brought in by the Axiom query.
  • If you want to edit the properties of existing variables, you can change the properties and then place a [Save] tag in the save-to-database control column. If you want to delete an existing variable, you would use a [Delete] tag.
  • If you want to create a new variable for that file group, you can enter the variable properties, then place a [Save] tag in the save-to-database control column.

When you perform the save-to-database, the variables will be created, updated, or deleted as appropriate.