web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Stuck on Office365Grou...
Power Apps
Unanswered

Stuck on Office365Groups.ListGroups and filter

(0) ShareShare
ReportReport
Posted on by 89

Hi,

 

I'm getting stuck on using the Office365Groups.ListGroups connector applying a filter.

I have a gallery where I want to filter groups by a value entered into a text input.

 

When trying to set the items of the gallery to 

   Office365Groups.ListGroups({'$filter': TextInput3.Text}).value

I get an error "Invalid filter clause". 
Unfortunately I did not find any examples on how to use the filter within this connector.
Any idea would be appreciated.

 

PS: Using the Graph API is no option

 

Regards

 

Stefan

 

Categories:
I have the same question (0)
  • StretchFredrik Profile Picture
    3,395 Super User 2025 Season 2 on at

    I also had problems figguring out how to write that so I ended up just doing a ForAll() and then i could do a simple if statement inside of that. It's not perfect, so somebody else probably has a better answer 😃 

  • GeoHris Profile Picture
    47 on at

    Hi @stefansc

     

    I had the same issue and was unable to resolve it or to find any additional information. 

     

    What I did in my case, I have used Search in my items formula: 

    Search(Office365Groups.ListGroups().value, TextInput3.Text, "description")

     

    This way I have been able to filter the gallery based on the text input. 

     

    Hope this helps 🙂

  • stefansc Profile Picture
    89 on at

    Hi @GeoHris ,

    this works but as Office365Groups.ListGroups() only returns 100 records it doesn't fit if you have hundred of groups.

  • Verified answer
    GeoHris Profile Picture
    47 on at

    Hi @stefansc

     

    The only thing that I managed to do and make it work, is the following: 

     

    Note, that when the text input is empty, I am receiving an error message that the query is not correct, but when I enter some text in the input, it is filtering correctly the gallery

     

    The filter formula which is expected should be in OData style: 

     

    Office365Groups.ListGroups({'$filter': "startswith(displayName," & "'" & TextInput4.Text & "'" & ")"}).value

     

     

    When I apply this in the items property, it is properly filtering the gallery: 

    GeoHris_0-1661351910308.png

     

  • stefansc Profile Picture
    89 on at

    Hi @GeoHris ,

    you made my day. This is exactly what I'm looking for.
    Regarding the empty search field I can manage it only search for the groups when the text input is not empty.
    Again, thanks a lot, you're genius. 

    Regards

     

    Stefan

  • daniel_garcia Profile Picture
    10 on at

    If you want an exact match (avoiding the starts with) you can do this:

     

    Office365Groups.ListGroups({'$filter': "DisplayName eq '" & TextInput4.Text & "'"}).value

     

  • charan270 Profile Picture
    18 on at
    Search(Office365Groups.ListGroups().value, TextInput3.Text, "description")
    This doesn't work. ListGroups doesn't return all the groups in the tenant. I was trying this option. The only options left are startsWith and EndsWith

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard