Skip to main content

Notifications

Community site session details

Community site session details

Session Id : WDw6X67AG6yf0EbGLt4EuD
Power Apps - Building Power Apps
Answered

How to get Office365Users.SearchUser({searchTerm: }).Mail to display ONLY text NOT table?

Like (0) ShareShare
ReportReport
Posted on 10 Apr 2018 17:01:34 by

Hello, 

 

I'd like to use a textbox to search for an O365User then show ONLY the Email Addresss of that person in another textbox. I get the error "The property expects text values but this rule produces incompatible table values". I don't want to use a Gallery in this case. What are the options? 

 

Thanks

Categories:
  • Community Power Platform Member Profile Picture
    on 11 Apr 2018 at 16:34:24
    Re: How to get Office365Users.SearchUser({searchTerm: }).Mail to display ONLY text N

    Interesting. I was able to suppress it using: 

     

     

    If(
    IsBlank(
    <text_box>.Selected),"_", (<--This is the default value of the <text_box> search)
    First(Office365Users.SearchUser({searchTerm:<text_box>.Selected.DisplayName})).Mail)

     

  • timl Profile Picture
    35,018 Super User 2025 Season 1 on 11 Apr 2018 at 15:52:30
    Re: How to get Office365Users.SearchUser({searchTerm: }).Mail to display ONLY text N

    Hi @ericonline

     

    When you enter no search term into the textbox, I suspect that the SearchUser function will return all users in your organisation. I imagine that '0151E132' relates to the first item in this list, and this might relate to some sort of service account.

  • Community Power Platform Member Profile Picture
    on 10 Apr 2018 at 23:43:00
    Re: How to get Office365Users.SearchUser({searchTerm: }).Mail to display ONLY text N

    Thank you Jeff and timl for your responses. 

     

    I ended up using timl's...

    First(Office365Users.SearchUser({searchTerm:<text_box>.Selected.DisplayName})).MailNickname

     ... but changed it a bit because the search <text_box> is actually a Sharepoint Person column. 

     

    The weird thing about this though is that when there is no search term in the search <text_box>, the results textbox shows "0151E132". What is this value? 


    Thanks

  • Verified answer
    timl Profile Picture
    35,018 Super User 2025 Season 1 on 10 Apr 2018 at 22:30:24
    Re: How to get Office365Users.SearchUser({searchTerm: }).Mail to display ONLY text N

    Hi @ericonline

     

    The SearchUser function can return multiple results depending on the search term that you provide. That's the reason behind the 'incompatible table values' error.

    There are a few ways to display the result in a textbox. To display the first result, you can use the following formula:

    First(Office365Users.SearchUser({searchTerm:<text_box>})).Mail


    If you want to display a coma separated list of email addresses, you can use the Concat function like so:

    Concat(Office365Users.SearchUser({searchTerm:<text_box>}), Mail & ", ")
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on 10 Apr 2018 at 19:53:46
    Re: How to get Office365Users.SearchUser({searchTerm: }).Mail to display ONLY text N

    Have you tried a List Box?

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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard