Sort appian group members for dropdown

Certified Senior Developer

Hi , How can I sort appian group members and bind to dropdown.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to ak0642

    You can just copy and paste this into your filter list, run a loop over it, and add the query filter.

    a!recordFilterList(
      name: "Members",
      options: a!forEach(
        items: a!groupMembers(
          group: cons!GROUP,
          pagingInfo: a!pagingInfo(
            startIndex: 1,
            batchSize: 100,
            sort: {
              a!sortInfo(
                field: "groupName",
                ascending: true
              ),
              a!sortInfo(
                field: "username",
                ascending: true
              )
            }
          )
        ).data,
        expression: a!recordFilterListOption(
          id: fv!index,
          name: fv!item,
          filter: a!queryFilter(
            field: recordType!Record.fields.fieldname,
            operator: "=",
            value: fv!item
          )
        )
      )
    )

  • 0
    Certified Senior Developer
    in reply to Harshit Bumb (Appyzie)

    Thank you. This is just giving me the group name, but the issue resolved with the code below.

    a!localVariables(
      local!assigneesDataSubset: todatasubset(
        arrayToPage: a!forEach(
          items: getdistinctusers(
            peopleArray: { cons }
          ),
          expression: {
            assignee: fv!item,
            assigneeName: rule!Exp_displayUserFirstLast(
              user: fv!item
            )
          }
        ),
        pagingConfiguration: a!pagingInfo(
          startIndex: 1,
          batchSize: -1,
          sort: a!sortInfo(
            field: "assigneeName",
            ascending: true()
          )
        )
      ),
      a!recordFilterList(
        name: "Assigned To",
        options: a!forEach(
          items: index(index(local!assigneesDataSubset,"data",{}),"assignee",{}),
          expression: a!recordFilterListOption(
            id: fv!index,
            name: index(index(local!assigneesDataSubset,"data",{}), fv!index, "-"),
            filter: a!queryFilter(
              field: Assignee record filed )}',
              operator: "=",
              value: fv!item
            )
          )
        )
      )
    )