cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RJOosthuizen
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

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

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

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.

 

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

Thanks!

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

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,239)