I'm using Umbraco 10 with Forms 10 as well. We are currently setting up a prevalue source to be pulled from our database, and was wondering if it was possible to sort the values in a different manner than the default alphabetical?
Could anyone point me in the right direction on this?
If you have control over the data in your database. You could modify the data to include a sorting column that represent the desired order. This could be a numerical values or string that determines the order you want. Then, when you retrieve the prevalues in Umbraco Forums, You can sort them based on this custom sorting column before populating the dropdown list.
You can create a custom precalue souce in Umbarco Forms by implementing a class that implements the Umbrco.Forms.Core.fieldPreValueProvider interface.
Umbraco Forms 10.4 Prevalue field sort
I'm using Umbraco 10 with Forms 10 as well. We are currently setting up a prevalue source to be pulled from our database, and was wondering if it was possible to sort the values in a different manner than the default alphabetical?
Could anyone point me in the right direction on this?
Thanks!
If you have control over the data in your database. You could modify the data to include a sorting column that represent the desired order. This could be a numerical values or string that determines the order you want. Then, when you retrieve the prevalues in Umbraco Forums, You can sort them based on this custom sorting column before populating the dropdown list. You can create a custom precalue souce in Umbarco Forms by implementing a class that implements the Umbrco.Forms.Core.fieldPreValueProvider interface.
is working on a reply...