Looking for the previous version? View v2024.06 documentation →
Variable Code Optimization
Use platform variables to drive data retention periods for centralised policy management.
Overview
The Variable Code Optimization feature enhances the Data Retention settings by allowing administrators to define and use platform-level variables to control retention periods dynamically. By selecting a predefined variable as the retention driver, the same configuration can be shared across multiple modules without hard-coding dates, and the retention period can be updated centrally by changing the variable's value.
Prerequisites
- You are logged in to Data Trust with an Admin Pro-User role.
- Admin Console access has been granted by your system administrator.
- Relevant variables have been created in the Data Trust variable repository.
Navigating to Variable Code Optimization
Path: Data Trust › Admin Console › System Preferences › Data Retention
Figure 1: System Preferences navigation option
Open Admin Console and navigate to System Preferences to access the Data Retention configuration tile where variable-based retention is configured. Admin Pro-User access is required to modify Data Retention settings, as incorrect configuration can result in unintended data deletion. Familiarise yourself with the current retention policy displayed on the Data Retention page before making any changes.
Figure 2: Data Retention option in System Preferences
Click the Data Retention tile on the System Preferences page to open the retention policy settings panel where both fixed-date and variable-driven retention options are available. The current active setting is highlighted on this page so you can identify whether a fixed date or a variable is currently in use. Variable-based retention is the recommended approach for organisations that need to manage retention centrally across multiple environments.
Figure 3: Default retention option selected
By default, the Data Retention page shows the second option (fixed date or previously saved variable) selected; review the current configuration carefully before making any changes. Note the existing retention period or variable name so you can revert to it if the new configuration does not produce the expected results. Click the Retain Data From dropdown to change the retention mode from a fixed date to a variable-driven setting.
Selecting a Variable for Retention
- Click the Retain Data From dropdown and select the variable option.
- Click Show Variable to browse available platform variables.
- Click Test to verify the variable resolves correctly.
- Click Save to apply the variable-based retention configuration.
Figure 4: Selecting Retain Data From option
The Retain Data From dropdown allows switching from a fixed date to a variable-driven retention period, providing dynamic control over data purge behaviour. When you select the Variable option, an additional Show Variable button appears to help you browse and choose the appropriate platform variable. This setting affects all data purge cycles across the platform, so confirm the change with your data governance team before saving.
Figure 5: Click on Show Variable button
Clicking the Show Variable button opens the platform variable browser, listing all variables currently defined in the Data Trust variable repository. The browser provides a searchable list to help you locate the correct variable quickly when the repository contains many entries. Only variables that resolve to a date or period value are suitable for use as data retention drivers.
Figure 6: Predefined Variables list
The predefined variables list displays all available platform variables with their names, types, and current values. Select the variable whose value represents the desired retention period — for example, a variable named 'DATA_RETENTION_DAYS' or 'PURGE_FROM_DATE'. Clicking the variable row highlights it as the selected option; click a Select or Confirm button to apply the selection and return to the retention settings page.
Figure 7: Selected variable metadata
After selecting a variable, its metadata — including the variable type, current resolved value, and description — is displayed on the Data Retention page for verification. Review this information carefully to confirm the variable holds the correct retention period or date before proceeding to test and save. If the displayed value is incorrect, update the variable definition in the platform variable repository and return to reselect it.
Figure 8: Test Result for selected variable
The test result panel confirms exactly what date or period the selected variable currently resolves to, allowing you to verify it matches your intended retention requirement before saving. A clear pass result with the expected resolved value is the only condition under which you should proceed to save the configuration. If the test result shows an unexpected value or an error, correct the variable definition and re-run the test before finalising the retention policy change.
Figure 9: Variable added and retention saved
A success confirmation message is displayed after saving, confirming the selected variable has been applied as the data retention driver for the Data Trust platform. From this point forward, all purge cycles will evaluate this variable to determine the retention cutoff date, so updating the variable value centrally is all that is needed to adjust the retention window in the future. Document the variable name and its expected values in your platform administration runbook so that future administrators understand how the retention policy is controlled.