cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Continued Contributor
Continued Contributor

combine IF with Lookup and Notify

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: combine IF with Lookup and Notify

@DAVIDPOWELL 
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."

 

View solution in original post

7 REPLIES 7
Highlighted
Super User III
Super User III

Re: combine IF with Lookup and Notify

@DAVIDPOWELL 
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."

Highlighted
Continued Contributor
Continued Contributor

Re: combine IF with Lookup and Notify

@mdevaney 

error  invaild number of arguments expected 1 received 2  

Highlighted
Continued Contributor
Continued Contributor

Re: combine IF with Lookup and Notify

@mdevaney    yes to your question.

 

Highlighted
Continued Contributor
Continued Contributor

Re: combine IF with Lookup and Notify

tbl_tasks   is a table on the screen

Highlighted
Continued Contributor
Continued Contributor

Re: combine IF with Lookup and Notify

DAVIDPOWELL_0-1600463233687.png

 

Highlighted
Super User III
Super User III

Re: combine IF with Lookup and Notify

@DAVIDPOWELL 
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."

 

View solution in original post

Highlighted
Continued Contributor
Continued Contributor

Re: combine IF with Lookup and Notify

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,286)