I want to do something like this:
CONST MIN_YEAR = 15
int[] yearOptions
for int i = year(date)-MIN_YEAR to year(date)+1 {
yearOptions.push(i)
}
How can I do this in Appian?I suspect this need to be an expression rule and the number 15 may change while I'm working on the interface.
Discussion posts and replies are publicly visible
You could use a script like the one below. Save the output in another variable and change the format as you see fit.
a!localVariables( local!years: 15, { a!forEach( items: enumerate(local!years+2), expression: year(today()) - local!years + fv!item ) } )