Hello, I have one dropdown field in which data is coming from one con

Hello,

I have one dropdown field in which data is coming from one constant. The constant is containing all department values.My SAIL code is as below :

------------
a!dropdownField(
label : "Department",
choiceLabels : cons!DeptNames,
placeholderLabel : "Select a Department",
choiceValues : cons!KeyDepts,
value : ri!dept,
saveInto : ri!dept
)
------------------------------------

The department names are coming like Xyz, Abc, Pqr and so on in dropdown values. Now I want that dropdown to come with sorting. So in my case I need output like Abc,Pqr,Xyz..

How I can achieve that?

Many Thanks!...

OriginalPostID-136809

OriginalPostID-136809

  Discussion posts and replies are publicly visible

Parents
  • As an example, consider:

    with(
    local!departments: {
    {department:"Xyz"},
    {department:"Abc"},
    {department:"Pqr"}},
              index(index(todatasubset(local!departments,
                        a!pagingInfo(
                                  startIndex: 1,
                                  batchSize: -1,
                                            sort: a!sortInfo(
                                                      field: "department",
                                                      ascending: true
                        )
              )
              ),"data",null),"department",null)
    )

    returns: Abc, Pqr, Xyz
Reply
  • As an example, consider:

    with(
    local!departments: {
    {department:"Xyz"},
    {department:"Abc"},
    {department:"Pqr"}},
              index(index(todatasubset(local!departments,
                        a!pagingInfo(
                                  startIndex: 1,
                                  batchSize: -1,
                                            sort: a!sortInfo(
                                                      field: "department",
                                                      ascending: true
                        )
              )
              ),"data",null),"department",null)
    )

    returns: Abc, Pqr, Xyz
Children
No Data