Can I Build a Dynamic Year Dropdown?

  • 11 April 2018
  • 7 replies
  • 12 views

Badge +9

I would like a dropdown with 10 consecutive years, the first year being the current year.

The following example, of course, won't work for the subsequent years, but you should understand what I'm trying to do with this.

Anyone with a successful method please share, thanks.

214228_pastedImage_1.png


7 replies

Userlevel 2
Badge +11

Hi Furst Lars‌,

I'm afraid this can currently only be done using JavaScript. Check Marian Hatala‌ reply in the following post: Adding options in choice fields dynamically in Nintex forms 2013.

NB: It seems the Choice control sees numbers as text, and as such the addition does not work..... Wrapping the year result in e.g. Abs() to get a number back rather than a string does not work either.

Badge +9

So I tried the following in the choices control:

214373_pastedImage_1.png214374_pastedImage_1.png

And when I attempt to round up the 2nd working value (2019.xxxx) using fn-Round, the form throws up an error, even thought the function is available to use!

The subsequent 3rd and 4th functions fail completely.

See how buggy this is? Are you listening, Nintex?

Userlevel 7
Badge +17

Can the runtime function be used, then the format date occur?

dateAddDays

Retuns the date with the specified number of whole days added to it.

Usage

dateAddDays(date, daysToAdd)

Userlevel 2
Badge +11

Or dateAddmonths(date, monthsToAdd).

Badge +9

dateAddDays is not available in the Nintex choice drop down. Only the Diff function is available. 

Userlevel 7
Badge +17

Ok, inline only for that area. What version are you on?

Badge +9

NF 2013 Version: 2.10.1.0

Reply