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

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
Super User
Super User

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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (33,675)