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 / ThisItem.Mail said "Th...
Power Apps
Answered

ThisItem.Mail said "This formula uses scope, which is not presently supported for evaluation"

(1) ShareShare
ReportReport
Posted on by

I have this in the Text property of a text box: 

 

 

If(
 IsEmpty(Office365Users.SearchUser({searchTerm: name4.Text})),
 "techsuppliermanagement@gmail.com",
 ThisItem.Mail
)

 

 

 However, the text wouldn't show up even if IsEmpty(Office365Users.SearchUser({searchTerm: name4.Text})) evaluates to true or false. It keeps saying that error. How do I fix this syntax?

 

Thank you!

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 
    You can grab the first result from SearchUserV2 and display it in the Text property of a label like this:

    With(
     {UserMail: First(Office365Users.SearchUserV2({searchTerm: name4.Text})).Mail},
     If(IsBlank(UserMail), "techsuppliermanagement@gmail.com", UserMail)
    )
    

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Firstly, the "This formula uses scope, which is not presently supported for evaluation" prompt message is not an error, it is just a prompt message from the Formula Bar Intelligence.

     

    Could you please share a bit more about your app's configuration? Do you add the Label inside a Gallery, and want to display the email value inside your Gallery?

     

    The Office365Users.SearchUser() formula returns a Record value rather than Table value, if you want to check if the Office365Users.SearchUser() formula result is Blank, you should use the IsBlank() function. The screenshot as below:

    5.JPG

    Please modify your formula as below:

    If(
     IsBlank(Office365Users.SearchUser({searchTerm: name4.Text})),
     "techsuppliermanagement@gmail.com",
     ThisItem.Mail
    )

     

    If you want to display the value inside a Label , please set the Text property to above formula. If you want to display the value inside a Text Input Box, please set the Default property of the Text Input box to above formula.

     

    Also please make sure the ThisItem.Mail formula could return a proper value. If you want to display corresponding email address based on the specific display name, please consider modify above formula as below:

    If(
     IsBlank(Office365Users.SearchUser({searchTerm: name4.Text})),
     "techsuppliermanagement@gmail.com",
     Office365Users.SearchUser({searchTerm: name4.Text}).Mail // Modify formula here
    )

    or

    If(
     IsBlank(LookUp(Office365Users.SearchUser(), name4.Text in DisplayName)),
     "techsuppliermanagement@gmail.com",
     LookUp(Office365Users.SearchUser(), name4.Text in DisplayName).Mail
    )

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • mdevaney Profile Picture
    29,989 Moderator on at

    @v-xida-msft 
    SearchUser is deprecated and should not be used because it could be deleted by Microsoft in the future.  Instead the poster should use SearchUserV2 instead.


    This will produce an incorrect result.  The SearchUser function returns a table which means IsBlank will always be false.  

    IsBlank(Office365Users.SearchUser({searchTerm: name4.Text})),

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney 

    I tried using your formula and it showed the correct email. However, when I clicked onto the Play Mode, the text disappears. I can only see it when I'm editing. The Display mode of this item is "Edit", so I should still be able to see it. Sometimes, the correct text even glitch between the wrong solution and the right solution. I'm wondering why this had happened?

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Firstly, for the Office365Users.SearchUserV2() function, you should use the following formula to reference the mail value:

    First(Office365Users.SearchUserV2({searchTerm: name4.Text}).value).Mail

    so you could try the following formula:

    If(
     IsBlank(First(Office365Users.SearchUserV2({searchTerm: name4.Text}).value).Mail),
     "techsuppliermanagement@gmail.com",
     First(Office365Users.SearchUserV2({searchTerm: name4.Text}).value).Mail
    )

     

    Have you applied your formula within the Default property of a Text Input box, same issue occurs? The text value would not be shown up in your published app?

     

    Please consider remove the Office 365 Users connection, then re-create a new connection to your Office 365 Users connector from your PowerApps, try the formula again in your app, check if the issue is fixed.

     

    Also please consider turn on the "Formula-level error management" option within Advanced settings of Apps settings of your app, then re-publish your canvas app, check if the issue still exists.

     

    Regards,

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard