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

RJOosthuizen 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.

 

RJOosthuizen 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!

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
RJOosthuizen 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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

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