Hey Community!
I'm stuck at a certain point in my development process. I need to receive a list of all GroupMembers of a Group in Smartsheet. I tried the following:
//First, getting all groups of our smartsheet plan and storing the result in variable grouplist
//Iterate through all Groups...
for (Group g : grouplist) {
// getMembers() returns a List of GroupMembers.
// If the list is not null, print out all email-adresses of groupmembers
if (g.getMembers() != null) {
for (GroupMember member : g.getMembers()) {
System.out.println(member.getEmail());
}
} else {
System.out.println("No Group Members");
}
}
As an output I receive the following:
Admin-Team
No Members found
Alle
No Members found
BO-Supporter
No Members found
CT-Supporter
No Members found
EV-Supporter
No Members found
GT-Supporter
No Members found
HA-Supporter
No Members found
HO-Supporter
No Members found
HP-Supporter
No Members found
It seems like the function of Group object "getMembers()" always returns null in my case, says I'm always receiving an empty list of GroupMembers. This can't be because all groups got members for sure. Also if I print out other group details like owner, id, ... everything works fine, just the getMembers() function is not working for me, returns always null.
Am I doing something wrong? Is the function getMembers() not working correctly?
Thanks for your support
Cheers
Chris