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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter gallery based o...
Power Apps
Unanswered

Filter gallery based on Status, Today and Completed Date

(0) ShareShare
ReportReport
Posted on by 72

I'm having difficulty getting this right.

  1. I have chkCompletedWSgals(check box) that when not checked shows requests scheduled for today AND request that are not completed before Today.
  2. chkCompletedWSgals= true than it should show items in 1 and requests that were completed Today.
  3. I have a date picker that should show only requests that were completed only on that day, if other than today.

My problem is with statement 2. When chkCompletedWSgals is false I get items in 1. When chkCompletedWSgals is true I ONLY see completed requests when I still want to see items from 1. I've changed things so many times 😐

 

SortByColumns(
If(
DatePickerWLscreen.SelectedDate = Today() And chkCompletedWSgals.Value = false,
Filter(
'Dispatch',
Truck.Value = "1234",
Or(
Status.Value = "In Progress",
Status.Value = "Approved"
),
ScheduledStartTime = Blank() Or ScheduledStartTime <= DateAdd(
Today(),
1,
Days
)
),
DatePickerWLscreen.SelectedDate = Today() And chkCompletedWSgals.Value = true,
Filter(
'Dispatch',
Truck.Value = "1234",
CompletedDate >= Today(),
CompletedDate < DateAdd(
Today(),
1,
Days
),
ScheduledStartTime = Blank() Or ScheduledStartTime <= DateAdd(
Today(),
1,
Days
)
),
Filter(
'Dispatch',
Truck.Value = "1234",
Or(
CompletedDate >= DatePickerWLscreen.SelectedDate And CompletedDate <= DateAdd(
DatePickerWLscreen.SelectedDate,
1,
Days
),
ScheduledStartTime >= DatePickerWLscreen.SelectedDate And ScheduledStartTime <= DateAdd(
DatePickerWLscreen.SelectedDate,
1,
Days
)
)
)
),
"BuildingText",
Ascending,
"Title",
Ascending,
"IDText",
Ascending
)

Categories:
I have the same question (0)
  • Verified answer
    SenoirB Profile Picture
    72 on at

    I figured it out. I wasn't being specific enough with all different scenarios. Code looks a hot mess but its working 🙂

     

    SortByColumns(
    If(
    DatePickerWLscreen.SelectedDate = Today() And chkCompletedWSgals.Value = false,
    Filter(
    'Dispatch',
    Truck.Value = "1234",
    Or(
    Status.Value = "In Progress",
    Status.Value = "Approved"
    ),
    ScheduledStartTime = Blank() Or ScheduledStartTime <= DateAdd(
    Today(),
    1,
    Days
    )
    ),
    DatePickerWLscreen.SelectedDate = Today() And chkCompletedWSgals.Value = true,
    Filter(
    'Dispatch',
    Truck.Value = "1234",
    Or(
    CompletedDate >= DatePickerWLscreen.SelectedDate And CompletedDate < DateAdd(
    DatePickerWLscreen.SelectedDate,
    1,
    Days
    ) And ScheduledStartTime = Blank(),
    CompletedDate >= DatePickerWLscreen.SelectedDate And CompletedDate < DateAdd(
    DatePickerWLscreen.SelectedDate,
    1,
    Days
    ) And ScheduledStartTime >= DatePickerWLscreen.SelectedDate And ScheduledStartTime <= DateAdd(
    DatePickerWLscreen.SelectedDate,
    1,
    Days
    ),
    Status.Value = "In Progress",
    Status.Value = "Approved"
    )
    ),
    Filter(
    'Dispatch',
    Truck.Value = "1234",
    Or(
    CompletedDate >= DatePickerWLscreen.SelectedDate And CompletedDate <= DateAdd(
    DatePickerWLscreen.SelectedDate,
    1,
    Days
    ),
    ScheduledStartTime >= DatePickerWLscreen.SelectedDate And ScheduledStartTime <= DateAdd(
    DatePickerWLscreen.SelectedDate,
    1,
    Days
    )
    )
    )
    ),
    "BuildingText",
    Ascending,
    "Title",
    Ascending,
    "IDText",
    Ascending
    )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard