Numeric Range Dropdown

Hi,
I need help in creating a dropdown with numeric range. So I want to display year 1998 - 2018 in a drop down. I want to always dynamically modify the values. The max will always be this year, and the min will be 10 years ago.

There’s an option for dynamic list, and type of choice is numeric range, but I don’t now how to get the choice source from. Also this dropdown will bind to numeric value in a table.

thanks.

Please advise.

You can create a series of “placeholder records” in your database for each year (2001, 2002, 2003, etc). You could create them as a number and do a transformation or you can create it as an actual date value.

Create the records for going back X years from today, the current year, and X records into the future.

Then, “Do a search for” placeholder records" where they fall between constraints relative to the current date and time.

Or you can pre-populate the dropdown with static numerical values if the list itself is static relative to today’s date. (Ie. on Jan 1 you adjust the first and last numbers).

1 Like

hmm… It looks like there’s no way to make it fully dynamic using just logic. Thanks.

@rkresnadi You could also use the “List of Numbers” element (within the JS Toolbox plugin):

In your app, after setting a List of Numbers element on the page, you can define the Starting Point, Length of List and Increment by 1 in this way:

Then use the List of Numbers as the data source in the dropdown element to get the last 10 years :slight_smile:

Preview:

Editor:

5 Likes

This is great! Thanks

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.