Hi @Mays ,
Could you please share a bit more about your scenario?
Could you please show more details about the data source you used to store the submitted Leave Request?
I assume that you have added corresponding columns (StartDate, EndDate and Requester) in your data source to store the New Leave Request Detail.
The StartDate column is used to store the Start date of the new Leave request, the EndDate column is used to store the End date of the new Leave request, the Requester column used to store the display name of the user who submit this Leave Request.
If you want to prevent powerapps submitting the days of a new leave request if it is already booked by the employee, I have made a test on my side, please take a try with the following workaround:
Set the OnSelect property of the "Submit" button to following:
If(
!IsBlank( /* <-- Check if the same Leave Request submitted from current sign in user is already existed in your data source */
LookUp('YourDataSource', StartDate = StartDatePicker.SelectedDate && EndDate = EndDatePicker.SelectedDate && Requester = User().FullName)
),
Notify("Your have submitted same Leave Request, please do not submit repeatedly!", NotificationType.Error),
Patch( /* <-- Submit new Leave Request */
'YourDataSource',
Defaults('YourDataSource'),
{
StartDate: StartDatePicker.SelectedDate,
EndDate: EndDatePicker.SelectedDate,
Requester: User().FullName,
...
}
)
)
Please take a try with above solution, then check if the issue is solved.
Note: On your side, you could search the submitted Leave Requests within your data source based on the new Leave Request before submitting, check if there is already a record submitted from you existed in your data source.
More details about the LookUp function and Patch function, please check the following article:
LookUp function, Patch function
Best regards,