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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ComboBox People Picker...
Power Apps
Suggested Answer

ComboBox People Picker to a DirecReportV2 Galleryview

(1) ShareShare
ReportReport
Posted on by 11
 
Hi Everyone,
 
So what I want to is pretty simple. I want to show the direct reports of the selected profile from a PeoplePicker combobox that is connected a Office365Users connector. How do i do it? I can't find any guidance on which property to select from DirectReportsV2 to display the data to a Gallery.
 
I would also need to have an add button for each record that will be returned so I can put them in a list. The goal is to select the most critical direct reports of a user.
 
Thank you in advance.
Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    156,167 Most Valuable Professional on at
    This will produce a Table of all the direct reports which you can use as the Items of you Gallery. You can then display the relevant field/s  you need (probably displayName). Unless you need one, a collection is not necessary and the Gallery will automatically update when a person is chosen in the Combo Box.
    Office365Users.DirectReportsV2(ComboboxName.Selected.UserPrincipalName).value
    The UserPrincipalName field assumes you are using Office365Users.UserV2() for the Items of the target Combo Box. If you are using Choices(), you can use the Email field.
     
    Note that value has a small v, 
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Suggested answer
    Valantis Profile Picture
    6,939 on at
     
    WarrenBelz's formula is correct for the gallery Items. For the Add button on each row to collect the critical direct reports:
    Gallery Items:
    Office365Users.DirectReportsV2(ComboBox1.Selected.UserPrincipalName).value
    Add button OnSelect (inside the gallery):
    If(
     Not(ThisItem.mail in colCriticalReports.mail),
     Collect(colCriticalReports, {Name: ThisItem.displayName, Email: ThisItem.mail})
    )
    This adds the selected person to the collection only once (avoids duplicates by checking the email first).
    To display the selected critical reports list, add a second gallery with Items set to colCriticalReports. Add a remove button there if needed: Remove(colCriticalReports, ThisItem).
     
      Best regards,

    Valantis   ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube
  • mjuref29 Profile Picture
    11 on at
    @Valantis hello. I am getting an error at this line: Not(ThisItem.mail in colCriticalReports.mail)
     
    The error is: 
     
    Do I need to declare colCriticalReports as a variable first? Thanks!
  • Suggested answer
    Valantis Profile Picture
    6,939 on at
     
    Yes, you need to initialize the collection first. Add this to App OnStart:

    ClearCollect(colCriticalReports, {Name: "", Email: ""}); Clear(colCriticalReports)

    This creates the collection with the right schema and then empties it so it starts blank. Power Apps needs to see the collection defined with its columns before the formula can reference colCriticalReports.mail.

    After adding that to OnStart, save the app and the error should go away.
     
      Best regards,

    Valantis   ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 362 Most Valuable Professional

#2
11manish Profile Picture

11manish 167

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard