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 / filter missing persons...
Power Apps
Unanswered

filter missing persons in group?

(1) ShareShare
ReportReport
Posted on by 153

When I use this command in my combobox, I miss at least 2 persons in the list

 

Filter('Office365-brugere'.SearchUser({searchTerm:""});UserPrincipalName in Office365Groups.ListGroupMembers("dddc5f9d-8e4a-491a-8c29-d846fae4fb69").value.mail)

 

Can't figure out why?

Categories:
I have the same question (0)
  • KeithAtherton Profile Picture
    3,705 Most Valuable Professional on at

    Hi @tusa,

     

    Missing data may be the result of delegation issues. More info on delegation here:

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/delegation-overview

     

    As a test, can you retrieve the missing persons into a collection by changing the following code searchTerm to find them. This will confirm they can be found by the Office365 connector.

    ClearCollect(colPersons; 'Office365-brugere'.SearchUser({searchTerm:""}))

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • uwenagel Profile Picture
    382 on at

    You have to look, which result you get from ...SearchUser. This table doesn't have a column named 'UserPrincipalName'!

     

    So you have to modify your Filter statement the following way:

    Filter('Office365-brugere'.SearchUser({searchTerm:""});Mail in Office365Groups.ListGroupMembers("dddc5f9d-8e4a-491a-8c29-d846fae4fb69").value.mail)

     

    Hope this helps. But honestly I do not understand that you get results at all with your filter query.

     

    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.

     

  • tusa Profile Picture
    153 on at

    It's the same weather I use Mail og UserPrincipalname

  • uwenagel Profile Picture
    382 on at

    What is the result of a collection with all the users in the group? Do you see all the users you anticipate?

    ClearCollect(colUsersInGroup;Office365Groups.ListGroupMembers(".....").value.mail)

     

  • tusa Profile Picture
    153 on at

    Not sure where to put that and where can I se the collection?

  • uwenagel Profile Picture
    382 on at

    When debugging an app I usually add things like that in the OnStart property of the app.

     

    Then you can trigger the OnStart and look for the contents of the collection in the editor here (this is an german but you will recognize the same positions in your language):

     

    uwenagel_0-1697452629073.png

     

    Another idea: Are you sure that the mail addresses in both sources are identical (look for capital letters!)?

     

    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.

  • tusa Profile Picture
    153 on at

    No matter if I run

    ClearCollect(colUsers; 'Office365-brugere'.SearchUser({searchTerm:""}))

    or

    ClearCollect(colUsersInGroup;Office365Groups.ListGroupMembers("dddc5f9d-8e4a-491a-8c29-d846fae4fb69").value.mail)

    Everything seems empty

  • uwenagel Profile Picture
    382 on at

    As I said, put this code into the OnStart property of the app and then trigger the OnStart manually (again it's the german interface).

     

    uwenagel_0-1697464263260.png

    Then you can view the results in the collection view as mentioned before.

     

    I would be surprised if everything is still empty then.

     

    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.

  • tusa Profile Picture
    153 on at

    That did the trick!

     

    I can see that the 

    ClearCollect(colUsersInGroup;Office365Groups.ListGroupMembers("dddc5f9d-8e4a-491a-8c29-d846fae4fb69").value.mail)

    reads out the 9 users in that group, so that's not the problem.

    but this one

    ClearCollect(colUsers; 'Office365-brugere'.SearchUser({searchTerm:""}))

    only reads out a table with 100 rows, and that's why the 3 missing people...

    Any idea on how to solve that?

  • Verified answer
    uwenagel Profile Picture
    382 on at

    The default result table size for SearchUser is 100. So you have to set the number of returned rows high enough to get the full list:

    ClearCollect(colUsers; 'Office365-brugere'.SearchUser({searchTerm:"";top:500}))

     

    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.

     

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard