Need to populate group and user names in dropdown as a list

Hi All,

By default Appian provides group and user picker with type ahead search feature. 

I have requirement with two drop downs, 1st  drop down want to pre-populate groups list and based on group

selection in 2nd drop down want to populate with user.

Please suggest any way achieving it.

Thanks,

Deepak

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Please try below piece of code , hope it helps

    a!localVariables(
    /*Constant which holds the array of groups*/
    local!groupList: cons!SRO_GROUPS,
    local!selectedGroup,
    local!selectedUser,
    local!userList: a!refreshVariable(
    value: getmemberuserspaging(
    groupId: group(local!selectedGroup, "id"),
    startIndex: 0,
    batchSize: - 1
    ),
    refreshOnReferencedVarChange: true
    ),
    {
    a!dropdownField(
    label: "Select Group",
    choiceLabels: a!forEach(
    local!groupList,
    rule!APN_displayGroupOrUsername(fv!item)
    ),
    choiceValues: local!groupList,
    value: local!selectedGroup,
    placeholder: "Select a group",
    saveInto: local!selectedGroup
    ),
    a!dropdownField(
    label: "Select Users",
    choiceValues: local!userList,
    choiceLabels: a!forEach(
    local!userList,
    rule!APN_displayUser(fv!item)
    ),
    value: local!selectedUser,
    saveInto: local!selectedUser,
    placeHolder: "Select User"
    )
    }
    )

  • Thanks a lot, Above code had got groups and users in Dropdown. But getting Group id in dropdown and user email id in dropdown. How to get Group name instead group id and username and last name instead emailid?

Reply Children