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 / combine IF with Lookup...
Power Apps
Answered

combine IF with Lookup and Notify

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I need somehow to combine an IF with Lookup and Notify.

from an OnSelect property.

IF 

Lookup(tbl_tasks, Status = "Open"   then

 

Notify("A Task is Already Open !", NotificationType.Warning,3000
)

Notify with a warning. and stop the routine from running the rest of the code.

 

Thanks

\Dave

 

 

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

    @Anonymous 
    Are you wanting to show a warning if the LOOKUP returned a value?  Here's how to do it.

    If(
     !IsBlank(Lookup(tbl_tasks, Status = "Open"),
     Notify("A Task is Already Open !", NotificationType.Warning,3000)
    )

     

    ---
    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
    Microsoft Employee on at

    @mdevaney 

    error  invaild number of arguments expected 1 received 2  

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @mdevaney    yes to your question.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    tbl_tasks   is a table on the screen

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    DAVIDPOWELL_0-1600463233687.png

     

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 
    Firstly, I missed a bracket to close ISBLANK

    If(
     !IsBlank(Lookup(your_datasource_name, Status = "Open")),
     Notify("A Task is Already Open !", NotificationType.Warning,3000)
    )

     

    Secondly, you can't reference tbl_tasks.  Instead, you'll need to reference the datasource in the Items property of tbl_tasks.

     

    ---
    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
    Microsoft Employee on at

    That paren helped , but i still am not thinking about it correctly.there will always be a task usually in "open" status. just trying to figure out a way to keep a person opening 2 tasks...i was hoping by putting the code in the "OnSelect" but the  "OnChange"  still fires ?

     

    or maybe

     

    manipulate the "Item" property in dwn_status_dwn   to  only display  ["Closed","In Progress"] if the status field has the word "Open" in lookup ? and vise versa..if  they have no "Open" tasks, it will display all three.? ["Open","Closed","In Progress"]

     

    dave

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
11manish Profile Picture

11manish 514

#2
WarrenBelz Profile Picture

WarrenBelz 419 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 295

Last 30 days Overall leaderboard