cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DPERRINS
Regular Visitor

Gallery SharePoint List - Filter 7 days ahead

Hi,

We have a SharePoint List which we are using to record people booking appointments, it has three columns; 'Reference', 'PickupDate' and 'Staff Name'.


We are using a PowerApp for the staff member to select a date they want to book which works using the line below on the item for the gallery, however we want to limit what dates are selectable to only a week in advance. I thought you would need to add 'PickupDate'>(Today()+7) but cannot figure out how/where?

 

Filter('iPad Pickup Booking List', Text(DatePicker1.SelectedDate) in PickupDate, IsBlank('Staff Name'.DisplayName))

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
shoog
Dual Super User
Dual Super User

It appears you are storing PickupDate as a text. Unless there is a very specific reason for this, please consider changing it to a date field. That would avoid some delegation problems and would be more intuitive.

 

For a date field you would use:

Filter( 'iPad Pickup Booking List', PickupDate >= DatePicker1.SelectedDate && PickupDate < DateAdd(DatePicker1.SelectedDate,7,Days))

 

If you have to keep it a text field, this should work:

Filter( 'iPad Pickup Booking List', DateValue(PickupDate) >= DatePicker1.SelectedDate && DateValue(PickupDate) < DateAdd(DatePicker1.SelectedDate,7,Days))

 

View solution in original post

2 REPLIES 2
shoog
Dual Super User
Dual Super User

It appears you are storing PickupDate as a text. Unless there is a very specific reason for this, please consider changing it to a date field. That would avoid some delegation problems and would be more intuitive.

 

For a date field you would use:

Filter( 'iPad Pickup Booking List', PickupDate >= DatePicker1.SelectedDate && PickupDate < DateAdd(DatePicker1.SelectedDate,7,Days))

 

If you have to keep it a text field, this should work:

Filter( 'iPad Pickup Booking List', DateValue(PickupDate) >= DatePicker1.SelectedDate && DateValue(PickupDate) < DateAdd(DatePicker1.SelectedDate,7,Days))

 

DPERRINS
Regular Visitor

This is great thank you @shoog , have a good Christmas! 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,615)