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 / Notify function with L...
Power Apps
Unanswered

Notify function with LookUp

(0) ShareShare
ReportReport
Posted on by 34

Hello,

 

I want to Notify user if Lookup does not find a matching value in the Dataverse. So far I have managed to write below code on OnChange event of a txtSearch but I am not sure what is wrong. DelayOutput is set to true 

 

If(
 !IsBlank(""),
 With(
 {
 wRecord: LookUp(
 'Owners',
 'Owner Email' = txtSearch.Value
 )
 }, 
 If(
 IsBlank(wRecord.'Managers-Email'),
 Notify(
 "No matching email found in the tool.",
 NotificationType.Error
 );
 Reset(txtSearch)
 )
 )
)

  

Categories:
I have the same question (0)
  • Rahman1005 Profile Picture
    109 on at

    Hi,

    can you please refer article examples are covered, hope is will helpfull.

    https://www.inogic.com/blog/2018/12/notify-functions-in-canvas-power-app/

     

    Thanks, 

  • aaaaaaaDDD Profile Picture
    34 on at

    How is this even related to my question?

  • aaaaaaaDDD Profile Picture
    34 on at

    Ah, I fixed by removing "!" on line 2

    IsBlank(""),

     

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hi,

     

    At present this code is not running at all due to your first condition within the If statement, as it will always evaluate to false:

     

    image.png

     

    You should be able to change this to refer to the length of the search text so that it only does the lookup when the search text input has a value in it:

    If(
     Len(txtSearch.Text)>0,
     With(
     {
     wRecord: LookUp(
     'Owners',
     'Owner Email' = txtSearch.Text
     )
     }, 
     If(
     IsBlank(wRecord.'Managers-Email'),
     Notify(
     "No matching email found in the tool.",
     NotificationType.Error
     );
     Reset(txtSearch)
     )
     )
    )

     

    Also it looks like you are referring to txtSearch.Value but I think this should actually be txtSearch.Text if it's an actual text input control.

     

    Try modifying the above code to meet your needs,

    Cheers,

    Sancho

  • aaaaaaaDDD Profile Picture
    34 on at

    Hello,

    Yes, I realized mistake in the formula. I am using PowerApps for Teams and hence I think textbox does not have "Text" property.

    I was expecting the "OnChange" event to be fired when the focus is moved out of the text input however  it is getting fired every time a text is added in the textbox. Any thoughts?

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard