cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Super User
Super User

Office365Groups.ListGroupMembers failed: The Method 'ListGroupMembers' has an invalid value for parameter 'groupid'

I have the following formula to check if the login user is inside a group named "SRM Dev Admin User" and redirect the user to a specific start page:-

 

sc.png

 

but the above formula is raising this error:-

 

Office365Groups.ListGroupMembers failed: The Method 'ListGroupMembers' has an invalid value for parameter 'groupid'

 

Any advice on this please?

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @johnjohn123 ,

I answered this earlier with a reference to my blog. Just get the Id of the group (as in first part of blog) and this works

If(
    User().FullName in Office365Groups.ListGroupMembers(
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
   ).value.displayName,
    AdminHomePage,
    VendorScoreCard_1
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

johnjohn123
Super User
Super User

@WarrenBelzi do not want to use the Group ID, i want to reference by name

@johnjohn123 ,

I am struggling to understand why not when it is so simple, but expanding the logic (this structure is actually in my blog)

With(
   {
      wGroupID: 
      LookUp(
         Office365Groups.ListOwnedGroups().value,
         displayName = "Your Group Name"
      ).id
   },
   If(
      User().FullName in Office365Groups.ListGroupMembers(wGroupID).value.displayName,
      AdminHomePage,
      VendorScoreCard_1
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

johnjohn123
Super User
Super User

@WarrenBelz  i can not use this formula inside the app startscreen property...

@johnjohn123 ,

I tested it here and got no errors, so not sure of the issue, however if it does not work (or the ID does not as well), then you may have to re-think your structure. I use a master SharePoint list of our employees (we have about 150 in the division) and have all their details in there. A lookup on that would certainly work.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,904)