Retrieve any configuration property in a Custom Policy check

Last updated: September 2, 2025

The liquibase_utilities.get_config_value python helper function allows you to retrieve any configuration property which includes environment variables, system properties, flow files, flow variables, and checks run command line arguments. Conceptually, it works like property substitution within a Custom Policy check.

Syntax: liquibase_utilities.get_config_value("CONFIGURATION_PROPERTY_VALUE")

Retrieve any configuration property in a Custom Policy check

Before you begin

Procedure

1

Create a new file in your Liquibase working directory or a subdirectory like /scripts.

This file will contain the Python script that is your custom policy check. In this example, we title our new file custom_check_no_tables.py.

2

Open the new custom_check_no_tables.py file and add the following custom policy check to it:

Retrieve any configuration property in a Custom Policy check
loading

Liquibase will run the check against every object in the database, so this script doesn't need a Python looping mechanism to iterate through database objects.

3

Navigate to your Custom policy check Python script and add the configuration value desired.

This configuration value could be an environment variable, a system property, flow file, flow variable, or a checks run argument. Helper function syntax: config_value=liquibase_utilities.get_config_value("your-config-value")

Examples of helper functions

dbplatfrom = liquibase_utilities.get_config_value("dbplatform")

currentloglevel = liquibase_utilities.get_config_value("LIQUIBASE_LOG_LEVEL")

currentchangelog = liquibase_utilities.get_config_value("changelogfile")

4

In this example, we will add the following piece of code to the Custom policy check which pulls in two configuration values called loglevel and mychangelog .

You can replace myloglevel and mychangelog with any property configured in the liquibase.properties file, flow file, global CLI parameters, JVM system properties, or as an environment variable.

loading
Once the helper function is added, your script will look similar to this:
loading