web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to check selected ...
Power Apps
Answered

How to check selected date is already in database

(0) ShareShare
ReportReport
Posted on by 76

Hello Everyone,

In my app have start date picker and end date picker.

DTtechies_0-1679571040686.png

i want to notify to user when start date and end date is already in database.

 my start date is 14th and end date is 16th and submit request. 

then again i select 13th is start date and 15th is end date then i want to notify to user that They have already requested in selected date in between

Categories:
  • Verified answer
    JD382 Profile Picture
    114 on at

    You can filter your data source and see if it returns anything. If it is blank then there is not any overlap. In this example DataSource is your database, StartDate and EndDate are the respective column names in your database.

    If(
     !IsBlank(
     Filter(
     DataSource,
     (StartDate >= StartDatePicker.SelectedDate && StartDate <= EndDatePicker.SelectedDate) || (EndDate >= StartDatePicker.SelectedDate && EndDate <= EndDatePicker.SelectedDate)
     )
     ),
     Notify("Date already selected", NotificationType.Error)
    )

     

  • DTtechies Profile Picture
    76 on at

    @JD382 

    thank for the answer, it is working now.

     

    Thank you

  • DTtechies Profile Picture
    76 on at

    Hi @JD382 

    your solution is working but i have another problem

     

    if i am taking request from 1st to 5th and try to take a request on 3rd then am i am able to take request.

     

    but in my case a dont want to allow user to take request between date

     

    thanks in advance

  • JD382 Profile Picture
    114 on at

    You can add another criterion to the filter function.

     

    || (startdate <= StartDatePicker.SelectedDate && enddate >= EndDatePicker.SelectedDate)

     

    This captures any existing requests that completely encompass the start and end dates that the user picks.

  • DTtechies Profile Picture
    76 on at

    Hi @JD382 

    i have taken a leave on 21st to 23rd

     

    and trying to take a leave on 21st, then its allow to take a leave, but i dont want to allow 21st date to take a leave

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard