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 / Prevent duplicate date...
Power Apps
Unanswered

Prevent duplicate date from date pickers to be patched in the table

(0) ShareShare
ReportReport
Posted on by 65

Hello!

 

I'm working on the Travel Expense App. The user is selecting the date range, for example from April 1st to April 5th by using date pickers control: "dateFrom" as date picker nr1, and "dateTo" as the second date picker.

 

This date range April 1st - April 5th is then patched to a Dataverse table "MT_Dates".

 

I would like to prevent the user to enter the same dates as previously, by either disabling those dates from the date picker, or by error message pop up, or some third option. As long as the user is unable to selected the dates that were already patched.

 

The code I'm using to Patch the dates from date pickers is:

 

Patch(
 MT_Dates,
 ForAll(
 Sequence(
 DateDiff(
 dateFrom.SelectedDate,
 dateTo.SelectedDate,
 TimeUnit.Days
 ) + 1
 ),
 {
 'Selected dates': 
 DateAdd(
 dateFrom.SelectedDate,
 Value - 1,
 TimeUnit.Days
 )
 }
 )
)

I have also attached the screens from my app and the screenshot of the Dataverse table, if it helps.

Thank you so much for reading my post and I look forward to your replies!

 

duplicate per diem.jpg

duplicate per diem.jpg
Categories:

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard