cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Powerapps to check against sharepoint for startdate and enddate

Hi , Could you help me to resolve .

 

i am creating an app for for the technicians(Each technician has an unique ID), Users will book for technicians and technician will be alloted for that work  with start and end date booked.

now when an new user try to book for same technician(ID) then he should not be allowed to book for same startdate and enddate as he is already occupied with work. so here i have to compare with sharepoint for that Id weather he is already booked for that time period based on startdate and enddate.

In App i have startdate and enddate and data is getting saved in sharepoint with startdate and enddate.

 

Could you please help me for this, i have tried multiple codes but unable to find correct solution.

i have tried below code but its not correct

Filter(
'Listname',
startDateColumn >= startDatePicker1.SelectedDate && endDateColumn <= endDatePicker2.SelectedDate /* <-- DateColumn is a Date Time type column in sharepoint list. DatePicker1 represents the Start Time, DatePicker2 represents the End Time */
)

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Powerapps to check against sharepoint for startdate and enddate

Hi @Vinith ,

 

Your formula is working because that the column's column type is Date and Time, but datepicker control only have date value.

 

Please try with below formula instead:

Filter(ListTest,Date(Year(DateTime), Month(DateTime), Day(DateTime)) >= DatePicker1.SelectedDate && Date(Year(DateTime), Month(DateTime), Day(DateTime)) <= DatePicker2.SelectedDate)

ListTest is my SharePoint list name.

DateTime is my date and time column's name.

 

This formula will result all the records that have DateTime column value in the date range. 

Capture.JPG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Frequent Visitor

Re: Powerapps to check against sharepoint for startdate and enddate

So the User should be able to allow to book other dates which are not booked(has to compare with backend sharepoint with start and end date)

Highlighted
Frequent Visitor

Re: Powerapps to check against sharepoint for startdate and enddate

Hi All,

 

Any inputs provided will be really helpful,, i have tried alot but no result.

 

 

Highlighted
Community Support
Community Support

Re: Powerapps to check against sharepoint for startdate and enddate

Hi @Vinith ,

 

Your formula is working because that the column's column type is Date and Time, but datepicker control only have date value.

 

Please try with below formula instead:

Filter(ListTest,Date(Year(DateTime), Month(DateTime), Day(DateTime)) >= DatePicker1.SelectedDate && Date(Year(DateTime), Month(DateTime), Day(DateTime)) <= DatePicker2.SelectedDate)

ListTest is my SharePoint list name.

DateTime is my date and time column's name.

 

This formula will result all the records that have DateTime column value in the date range. 

Capture.JPG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Powerapps to check against sharepoint for startdate and enddate

@v-monli-msft 

 

Hi Mona,

 

Thanks for the solution but i dont need to take in gallery.

 

I want to just highlight an error if the startdate and enddate are already selected or exits in backend sharepoint againt same ID.

 

Main concept is User should be stopped from selecting same date , As they might be blocked against another work.

In my backend database i have already Start_date, end_date with date.

 

In frontend too i have Startdate, enddate , when i select startdate and enddate , It has to search against sharepoint whether the selected dates are already booked for that particalar ID:

 

if while selecting date and time is not possible then we can take an button and write code on it aswell to populate error if the selected dates are already exists in sharepoint

 

Thanks in Advance ,


@v-monli-msft wrote:

Hi @Vinith ,

 

Your formula is working because that the column's column type is Date and Time, but datepicker control only have date value.

 

Please try with below formula instead:

Filter(ListTest,Date(Year(DateTime), Month(DateTime), Day(DateTime)) >= DatePicker1.SelectedDate && Date(Year(DateTime), Month(DateTime), Day(DateTime)) <= DatePicker2.SelectedDate)

ListTest is my SharePoint list name.

DateTime is my date and time column's name.

 

This formula will result all the records that have DateTime column value in the date range. 

Capture.JPG

 

Regards,

Mona


 

Note: I have many UserID each ID has their own specific startdate and enddate.

 


"

 

 

 

Highlighted
Frequent Visitor

Re: Powerapps to check against sharepoint for startdate and enddate

Note: I dont need time , I just need Date to be searched against sharepoint and populate error if they overlap with already existing selected dates

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,178)