Skip to main content

Notifications

Community site session details

Community site session details

Session Id : vr2vSwIaBuimpBVPkDbVlN
Power Apps - Building Power Apps
Answered

How do I use Office365Users as a search feature in a form?

Like (0) ShareShare
ReportReport
Posted on 15 Aug 2019 19:10:23 by 172

I've created a simple form which is created from a sharepoint list. On one of my fields, i would like the user to be able to search for a O365 user and select the name. I've looked everywhere on these boards and haven't been able to figure out how to make this happen (if it's possible). Can someone offer some feedback as to what I should do? 

image.png

 

I am very new at this and would appreciate any help I can get!

  • v-siky-msft Profile Picture
    on 21 Aug 2019 at 01:54:17
    Re: How do I use Office365Users as a search feature in a form?

    Hi @slan2018 ,

     

    Oh a frown face haha Smiley Sad

    The formula is: Office365Users.SearchUser({searchTerm: (""),top:TopRecordNumber})

    The maximum value of user records retrieved from Office365Users.SearchUser() function at once is 999.

     

    you can use collection to work around this limit.

    For more information, please refer to this thread: 

    https://powerusers.microsoft.com/t5/General-Discussion/Office365Users-Connector-Company-Directory/m-p/205498#M65890

     

    Best regards,

    Sik

  • slan2018 Profile Picture
    172 on 20 Aug 2019 at 13:31:14
    Re: How do I use Office365Users as a search feature in a form?

    @v-siky-msft Trying to enter but on my screen your formula is showing a frown face haha. Not sure what goes in place of the frown?

    image.png

    image.png

     

    Do you have any advice as to the top # section? We have a whole lot of users on our domain so i want to search them all, would this be for the # of matches returned? 

  • v-siky-msft Profile Picture
    on 20 Aug 2019 at 01:46:09
    Re: How do I use Office365Users as a search feature in a form?

    Hi, @slan2018 

     

    The item property of combo box needs some parameters, please set as 

    Office365Users.SearchUser({searchTerm:(""),top:<TopRecordNumber>})

     TopRecordNumber is the number of record you want to search.

     

    And you also need to change the Display Fields and Search Fields as ["DisplayName"].

     

    Best regards,

    Sik

  • ck25415 Profile Picture
    294 on 19 Aug 2019 at 20:47:56
    Re: How do I use Office365Users as a search feature in a form?

    @slan2018 That looks goo to me, were you able to add the "RepLookup" field into the form in PowerApps ?

  • slan2018 Profile Picture
    172 on 19 Aug 2019 at 19:48:33
    Re: How do I use Office365Users as a search feature in a form?

    @ck25415 can you give me more information on that? I went to my sharepoint list and added a "People or Groups" column called RepLookup. Is that what I'm supposed to do? I kept the "Choose from" on All Users. I want it to show at minimum a name when you search, but other info would be nice. 

    image.png

     

    I've never done this before, any help would be greatly appreciated!

  • slan2018 Profile Picture
    172 on 19 Aug 2019 at 17:47:44
    Re: How do I use Office365Users as a search feature in a form?

    Thank you @v-siky-msft ! I think I may have pressed Solution a moment too soon. I followed your instructions, but when I play the app I am unable to search/Type/do anything except see a blue bar. 

     

    image.png

     

    Did I miss a property? Maybe an OnSelect? The Data search and display items seem wrong but I dont know enough about it. 

    image.pngimage.png

    image.png

  • Verified answer
    v-siky-msft Profile Picture
    on 16 Aug 2019 at 06:24:37
    Re: How do I use Office365Users as a search feature in a form?

    Hi @slan2018 ,

     

    I have a solution to solve your problem.
    You can refer to following step:
    1. Unlock the Sales Rep Name_ Data card1
    2. Delete the Text input control of that data card, and add a Combo box
    3. Set Item property of combo box as below

    Office365Users.SearchUser()

    4. Set Update property of combo box as below

    ComboBox.Selected.DisplayName

    5. Set Y property of ErrorMessage as below

    ComboBox.Y + ComboBox.Height

    So that you can search office365 users in the form, and submit your form.

     

     

    Best regards,
    Sik

     

  • ck25415 Profile Picture
    294 on 15 Aug 2019 at 20:45:35
    Re: How do I use Office365Users as a search feature in a form?

    @slan2018 Since you are using a SharePoint list as a datasource for this form, create a people picker field "Sales Rep Name" in the SharePoint list and use it in the form.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,077 Most Valuable Professional

Leaderboard
Loading started