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 / Office365Users Connect...
Power Apps
Answered

Office365Users Connector Help

(0) ShareShare
ReportReport
Posted on by 194

Hi Hivemind!

 

So I have a combobox search using the Office365Users connector that has this code for the items:

 

 

Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}), AccountEnabled = true)

 

 

 

This gives me a list of names i can search of people within my org. I have another field on the screen to automatically display information like email, address, etc. However those fields (email as an example) looks like this:

 

 

If(Not(IsBlank(ComboBox1.Selected.DisplayName)), First(Office365Users.SearchUser({searchTerm:ComboBox1.Selected.Id})).Mail)

 

 

 

My Issue is there is someone in our org (and possibly others) that have 2 accounts. So if I select one of the options in the first drop down the email displays, but if i select the second person the email is wrong because the email field is matching on the first match to the name.

 

I understand the issue, but is there a way to search by the ID selected in the combobox that way all these other fields will match and be the information for the row i'm selecting in the first drop down for people with the exact same name?

Thank you for the help on how to go about this!

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,242 Most Valuable Professional on at

    Hi @Nicci ,

    One way of finding the right entity is to have a two column combo box

    WarrenBelz_0-1702588246749.png

    with the Items

    Filter(
     Office365Users.SearchUser({searchTerm: Self.SearchText}),
     AccountEnabled = true
    )

    ansd then your result (the message can be "" if you do not want one)

    Coalesce(
     ComboBox1.Selected.Mail,
     "Message Here"
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Nicci Profile Picture
    194 on at

    This worked perfectly! I didnt even need the ID as a second column. I was trying to redo the search to auto fill and didnt realize you can use coalesce from the combobox so it just prefills the one you selected!!! Thank you!

  • Nicci Profile Picture
    194 on at

    Ah actually because I prepopulate the name in the first combobox, the coelesce is not triggering because you need to click it. Is there a way to do this by just pre populating everything? Most of the time people are going to leave it to the default logged in user name and email and everything should prefill, but sometimes it is filled out on behalf of someone else, so when searching for names and selecting the person who shares the same name with another employee is where the issue is. I need it to pre populate based on what is in the combo box.

     

    It seems the way it works is nothing is pre populated even though there is a selected name already unless i remove and select it again which is tedious.

  • WarrenBelz Profile Picture
    155,242 Most Valuable Professional on at

    @Nicci ,

    What is the current DefaultSelectedItems ?

  • Nicci Profile Picture
    194 on at

     Its set to the logged in user, like this:

     

    Filter(Office365Users.SearchUser({searchTerm:Office365Users.MyProfile().DisplayName}), AccountEnabled = true).DisplayName

     


    The combobox is changeable if the user is filling out the form on behalf of someone like their supervisor.

     

    When it's this case the Coelesce will work because you're clicking someone else, however for 99% of the time the defaulted user who is logged in is the one filling it out and now the rest of the fields like email are not pre- populating.

     

    Also the way it gets the current user is by doing a search user function of the profile by displayname, which i'd be very curious if the person with the same name as another employee would get the correct ID if she were to log in. I dont have a way for her to test that at this point, but I betcha it just uses the first match or maybe causes and error because 2 results would come back. Not sure.

  • Verified answer
    WarrenBelz Profile Picture
    155,242 Most Valuable Professional on at

    @Nicci ,

    If you get rid of .DIsplayName on the end and simply display this in the combo box properties, the rest of the user's details should be available without actually selecting.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Nicci Profile Picture
    194 on at

    That did it! Big oversight on my part. Thank you so much!!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard