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

Validate if Date exist or not in Sharepoint

Hello Friends,

 

I have a question, I am trying to check if a date exists in my SharePoint list and if does, just show a pop-up and if not, let me do the patch, so I am trying a lot of formulas but they did not work, any clue or Idea?(date column with date picker)

 

I have this now but it shows me that with all days, the record exists: 
If(LookUp('LMS Tier 1').TierDate = DatePicker1.SelectedDate, Notify("exist"), Notify("does not")) or
If(CountRows(Filter('LMS Tier 1',TierDate )) = DatePicker1.SelectedDate,Notify("does") , Notify("Does Not Exist"))
and more, any idea?

 

Thanks in advance.

6 REPLIES 6
Highlighted
Super User III
Super User III

If(CountRows(Filter('LMS Tier 1',TierDate = DatePicker1.SelectedDate)),Notify("does") , Notify("Does Not Exist"))

Or
If(CountRows(Filter('LMS Tier 1',Text(TierDate),"dd-mmm-yyyy")= Text(DatePicker1.SelectedDate),"dd-mmm-yyyy")),Notify("does") , Notify("Does Not Exist"))
Highlighted

neither of those options worked.

Highlighted

Have tested it worked (Attached)
If(CountRows(Filter('LMS Tier 1',DateValue(TierDate) = DateValue(Text(DatePicker1.SelectedDate)))) >1,
Notify("Exist",NotificationType.Success),Notify("Does Not Exist",NotificationType.Error))
 
 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Highlighted
Super User II
Super User II

The function below works, and does not appear to have any issues with delegation.

For my example, it's checking if an Account was created on the selected date.

PowerAppFormula_FindDateInColumn.png

Updated with your references:

If(!IsBlank(LookUp(AddColumns('LMS Tier 1',"appLookUpDate",Text('TierDate',DateTimeFormat.ShortDate)),Text(DatePicker1.SelectedDate,DateTimeFormat.ShortDate)=appLookUpDate)),Notify("Found",NotificationType.Success),Notify("Not Found",NotificationType.Error))

Highlighted

The only thing I would like to flag is that AddColumns is only partially delegable. What I mean by that is that parameter of AddColumns is delegable (or can be based on your data source and formula) but irrespective of whether the parameter of AddColumns is delegable or not, AddColumns output is not. Which means it will always be subject to the non-delegation limit.

AddColumns used to be my favorite solution approach until I found this out the hard way. Reason why it was hard? Because this is one delegation issue for which the App Checker doesn't throw a delegation warning. That's why I call it the "Invisible Delegation Issue"!

Here is a link to my blog post about this: https://thepoweraddict.com/the-invisible-delegation-issue/

Just wanted to throw it out there so you can factor that in if it affects you.

Thanks,
Hardit Bhatia
https://thepoweraddict.com

Highlighted

Thanks @PowerAddict!

I was worried about that, actually. It's not throwing an error, so let's just blame MSFT. 🤣

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,034)