Is it possible to create Constants at runtime during a process execution? T

Certified Senior Developer
Is it possible to create Constants at runtime during a process execution?
The use case is to have an excel file with all the details for the constant and creating the same by uploading the file to a process. The process would then take the data from excel file to create the constants.

Thanks...

OriginalPostID-94430

OriginalPostID-94430

  Discussion posts and replies are publicly visible

  • Can't you use a database to store these values and refer from the db? Your end result will be the same. I think for such dynamic behavior where the data is externalized and volatile, an external persistence method would be a lot more scalable and easier approach.
  • 0
    Certified Senior Developer
    Hi Sathya

    What I am trying to achieve is to create constant at runtime. Let say suppose you have to create dropdowns, checkbox and radio buttons on screens. The best way is to give Labels and values by constants. Now what I am trying to achieve is to have all the constants defiend in an excel file with all the details (constant name, value, multiple, description) and then creating a process which would create constants for me rather than going for a usual approach of creating constants one by one.
  • With the example you've provided, I would recommend using the database as the best approach. You can populate drop downs directly from a database using query rules. You should be able to achieve your requirement using a single table that contains a key to identify the 'constant' you're trying to define, a label column that holds the label values and a value column that holds the corresponding values.
    Define a CDT to map to this structure and use query rules to pull the data you want.
    Now, you can build a process to access/store or update these constants rather than maintaining an excel document which is prone for error when multiple people end up maintaining multiple versions. With the DB approach, you can maintain a single source of truth.
  • I have a similar requirement where I need to maintain all the constants in a property file that I will need to read and use that to update constants. And this needs to be developed as a stand alone java component that needs to run out of Appian. Something that can be run during deployment. It can use public Appian api to connect to Appian server and update the constants on the server automatically. The idea behind doing this is to avoid making constant updates manually during deployment. We have a lot of web services that we use whose urls are currently referred from constants, and it is getting tedious to keep up with the changes on those. So if we can manage using a property file, we can keep it at one place.