cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

checking if entry exists today and display a popup

Hi,

 

I have an app where an employee can click a button and a popup appears confirming if they want to submit. When they click on the confirmation, it creates an item in my sharepoint list. Now I want to give the user a warning popup or message if they press the button again to tell them that an entry exists already for today and if they would like to create another one.

 

Employees are allowed to sunbmit more than 1 entry a day but I want to warn them that an entry already exists for today. So basically I want to check all entrys of today and see if the current user has an entry, depending on that then i want to display a message.

 

Thaks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: checking if entry exists today and display a popup

I would combine a LookUp to find a record that matches and combine that with the IsEmpty function. So warn user If(!IsEmpty(Lookup(DataSource, Match Criteria, AColumn) ), true, false). Probably not perfect but that is where I would start from. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: checking if entry exists today and display a popup

I would combine a LookUp to find a record that matches and combine that with the IsEmpty function. So warn user If(!IsEmpty(Lookup(DataSource, Match Criteria, AColumn) ), true, false). Probably not perfect but that is where I would start from. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Highlighted
Helper I
Helper I

Re: checking if entry exists today and display a popup

So I tried it but it only executes the true statement regardless of whether the database entry exists or not.

 

This is how my statement looks: If(!IsEmpty(LookUp('Database', DateCreated = Today() && PersonEmail = User().Email, PersonEmail) ), UpdateContext({showPopup:true}), UpdateContext({showPopup3:true}))

 

I am not sure whether it matters what column I return(in this instance it is personEmail)? I tested the lookup alone on a label and it returns the email if an entry exists otherwise blank. So the isEmpty should work right?

 

It should be able to show 1 of 2 popups depending on the condition.

 

Helper I
Helper I

Re: checking if entry exists today and display a popup

So I changed the isEmpty to isBlank just to see and it worked! 

Thanks!

Highlighted
Super User
Super User

Re: checking if entry exists today and display a popup

Glad you got it and shame on me for getting the two functions mixed up. Boo!

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Highlighted
Helper I
Helper I

Re: checking if entry exists today and display a popup

The IsEmpty function makes more sense since it checks to see if an entry exists where as the IsBlank checks for NULL values so I would also think that the IsEmpty would work better. Anyway thanks again fot the help!

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 (6,552)