We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.

How to pull email address of the users who are part of any specific Appian group.

Hi,

I was able to pull list of users from the group call "AA ADMIN" by using a contact "AA_ADMIN".

Now, is there a way I can pull the email addresses of these users.

Any advises please.

a!localVariables(
  local!listOfUsers: getdistinctusers(togroup(cons!AA_ADMIN)),
  local!listOfUsers
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I'd prefer the newer OOB function, a!groupMembers()...

    a!localVariables(
      local!userList: a!groupMembers(
        group: cons!AA_ADMIN,
        memberType: "USER"
      ),
      
      a!forEach(
        local!userList,
        user(fv!item, "email")
      )
    )

  • Mike,

    I would like to concatenate of email address of two different variables. When I try to perform union of two local variables, I am encountering an issue.

    First local variable "local!membersEmail" of type "List of Variant" and second variable "adminUsersEmail" is of type List of Text String.

    Is it advisable to convert first variable to tostring() 

    a!localVariables(
      local!membersEmail: index(
        rule!AA_getMembers(
          key: {1,2,10},
        ),
        "email"
      ),
    
      local!adminUsers: a!groupMembers(group: cons!AA_ADMIN, memberType: "USER"),
      local!adminUsersEmail: a!forEach(
        local!adminUsers,
        user(fv!item, "email")
      ),
      local!emailList: toemailaddress(
        union(
          local!membersEmail,
          local!adminUsersEmail,
        )
      ),
      local!emailList
    )

  • +1
    Certified Senior Developer
    in reply to swapnar6405

    HI , Can you try below updated code?

    a!localVariables(
      local!membersEmail: toemailaddress(index(
        rule!AA_getMembers(
          key: {1,2,10},
        ),
        "email"
      )),
    
      local!adminUsers: a!groupMembers(group: cons!AA_ADMIN, memberType: "USER"),
      local!adminUsersEmail:toemailaddress(a!forEach(
        local!adminUsers,
        user(fv!item, "email")
      )),
      local!emailList: union(
          local!membersEmail,
          local!adminUsersEmail,
        ),
      local!emailList
    )

Reply
  • +1
    Certified Senior Developer
    in reply to swapnar6405

    HI , Can you try below updated code?

    a!localVariables(
      local!membersEmail: toemailaddress(index(
        rule!AA_getMembers(
          key: {1,2,10},
        ),
        "email"
      )),
    
      local!adminUsers: a!groupMembers(group: cons!AA_ADMIN, memberType: "USER"),
      local!adminUsersEmail:toemailaddress(a!forEach(
        local!adminUsers,
        user(fv!item, "email")
      )),
      local!emailList: union(
          local!membersEmail,
          local!adminUsersEmail,
        ),
      local!emailList
    )

Children
No Data