Null value in Environment Specific Constant

Certified Senior Developer

Hi Team

I am using an environment specific date constant.

This is an array of dates constant .. I want to deploy to higher environment but in such a manner that the constant should be null ( because I will be appending values in it via process model as part of logic later )

While deploying I am passing nothing in the custom properties file 

eg :  

content._a-0000ed12-853e-8000-9c18-011c48011c48_2772176.VALUE=

But when seen in higher environment it comes like this : 

I wanted it to be blank ( i.e. nothing in the constant ) .. somewhat like this : 

Is there any way we can achieve this via custom properties ?

  Discussion posts and replies are publicly visible

  • Hi ,

    Yes you can update the value of environment specific constant via custom properties file
    which you need to use during deployment
    Within the custom properties file, look for the constant and update its value after removing the HASH(#) from the beginning of the line.

    Once the constant has been deployed, you can use it to update it via process model.

    Hope that's helpful

  • If you leave that line of the properties file commented with #, I'd say it will deploy the constant the way you're looking for. If not, I would try to declare it as null, not sure tho.

  • 0
    Certified Senior Developer

    1. In the lower environment, where you have the array of dates constant defined, leave the constant value empty. Do not provide any values in the constant. 2. When deploying to the higher environment, in the custom properties file, do not provide any value for the constant. Leave the property value blank.

    For example, in the custom properties file, the entry for the date constant would look like this:

    date_constant=

    By leaving the property value empty, the constant in the higher environment will be deployed as a null value, as desired.

  • 0
    Certified Lead Developer

    There's a reasonable workaround to deploy a "default value" of environment specific constants to higher environments without needing a Properties file, and this sounds like a good use case for using this workaround:

    1. create the constant in your dev environment with exactly the default value set how you want (clearing out any dev-specific data or setting if necessary)
    2. UNCHECK (if needed) the "environment specific" checkbox in the Dev copy
    3. deploy the constant (on its own) to all higher environments
    4. CHECK the "environment specific" checkbox in the Dev copy
    5. deploy the constant (again by itself) to all higher environments again - their "environment specific" setting will now be changed.