Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • qsstearns 1 post 21 karma points
    Aug 09, 2023 @ 18:04
    qsstearns
    0

    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!

  • Amanda West 4 posts 94 karma points
    Aug 11, 2023 @ 06:26
    Amanda West
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft