List of users and groups in the system and a way to download a csv file

Hi All,

I am trying a way to create a list of users and their associated groups and download it in a csv file.

This is the code snippet to generate list,
a!localVariables(
   local!users: getallusers(0, -1),
   a!formLayout(
      label: "Users & Groups",
      contents: {
         a!forEach(
          items: local!users,
          expression:
             a!textField(
                label: "UserName :" & " " & user(fv!item, "username")&","
                & " "&"Name :"& " " &user(fv!item, "firstName")
                & " " &user(fv!item, "lastName")&","
                & " "&"Email :"&" " &user(fv!item, "email") ,
                      value: getgroupnames(
                      getgroupsformemberuser(
                      fv!item
               )
            ),
         readOnly: true
         )
     )
    }
  )
)

Is there a way that I can put it in a grid and download it as csv file?

  Discussion posts and replies are publicly visible