Date format

Certified Associate Developer

Hello, my team and I are creating an application regarding pensions data. 

I wanted to come here and ask: what is the best way to handle date formats if I want it to be customizable. I want to store somewhere these formats (for example: shortDate, longDate, technicalDate). 

We set it up as a decision, where the different formats are stored and passed to an expression rule, like the image.

for now it works, of course, but we would like to make understadable even to other developer who are not necessarily used to Appian. How can we make it "smart", whenever i want to set up a date format in a ui field, i will have to pass which format I want and the data. This is what we are aiming for, making it understand that if I choose a "wrong" format it breaks. I would want it to behave like colors in certain components, I can only choose between few like POSITIVE, NEGATIVE or SECONDARY, for example, I want my date format set up ti suggest and accept ONLY shortDate, longDate, techinicalDate.

Is there any way that Appian make it pssible for us to do so? thank you so much!

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Does not support custom enum-like suggestions for your own expression rule inputs the way built-in component parameters do, so you cannot make dateFormat accept only shortDate, longDate, or technicalDate at design time.
    The closest you can achieve is combining a Decision Object for centralized format mapping with an Expression Rule that validates the input and throws a visible error for invalid values, acting as a runtime guard. For better developer guidance, document your accepted values ("short", "long", "tech") directly in the rule input description to ensure teammates know exactly what to pass. If you later require better reuse and fewer typos across a larger, widely used application, you can easily transition to grouped constants, but keeping your logic in one decision object is the most pragmatic and maintainable approach for your current needs.