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

Re: Validate if Date exist or not in Sharepoint

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

Re: Validate if Date exist or not in Sharepoint

neither of those options worked.

Highlighted
Community Champion
Community Champion

Re: Validate if Date exist or not in Sharepoint

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

Re: Validate if Date exist or not in Sharepoint

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

Re: Validate if Date exist or not in Sharepoint

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

Re: Validate if Date exist or not in Sharepoint

Thanks @PowerAddict!

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,170)