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 SP Date...
Power Apps
Answered

Filter Gallery SP Date Column minus Text Column with number value

(0) ShareShare
ReportReport
Posted on by 67

Hi,

 

This seems straight forward, but I am lost as many solutions are between selected controls on the screen as dropdowns or pickers. My need for what I am trying to accomplish is to filter a gallery against SP List 'Patient_Rec' and only show records equal to or older than the value from the number of days in CycleDays column (text value) and LastVisit (Date column).

 

Ex: If LastVisit was 2/10/2024 and CycleDays is 5, make visible in gallery those records meeting TRUE, otherwise do not display.

 

Thanks for any help!

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @GigaenvyTAG69 - see the sample pattern below to apply to the Items property of a Gallery:

     

    Filter(
     Patient_Rec,
     LastVisit > Date(
     2022,
     10,
     2
     ),
     StartsWith(CycleDays, "5")
    )

     

    However, I would assume the LastVisit date and CycleDays should be dynamic. If yes, you will need to use a control. For example a Date Picker control for the date and a Dropdown for cycle days:

     

    Filter(
     Patient_Rec,
     LastVisit > DatePicker1.SelectedDate,
     StartsWith(
     CycleDays,
     Dropdown1.Selected.Value
     )
    )

     

  • GigaenvyTAG69 Profile Picture
    67 on at

    Hi Amik,

     

    This is a good start; I'll work on a control later. For now, I need every record displayed that is equal to or older than the CycleDays number value from the LastVisit (Date column).

     

    My example above was only for one record. Imagine SP List Patient_Rec has the following records. Therefore, display on records that are TRUE.

     

    Display or HideCycle DaysLast VisitToday's Date (Now)
    Hide52/15/20242/18/2024
    Hide72/15/20242/18/2024
    Display72/10/20242/18/2024
    Display52/14/20242/18/2024
    Display32/16/20242/18/2024
    Hide12/18/20242/18/2024

     

    Thanks,

     

    Tom

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @GigaenvyTAG69 - I do not know what this means:

     

    "equal to or older than the CycleDays number value from the LastVisit (Date column)."

     

    Do you mean equal to or older than the Last Visit Date plus CycleDays?

  • GigaenvyTAG69 Profile Picture
    67 on at

    yes Amik! Sorry for that.

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @GigaenvyTAG69 - you can use the AddColumns and DateAdd function. Note that these functions are not delegable:

     

    With(
     {
     _transformed_data: AddColumns(
     Patient_Rec,
     "LastVisit_plus_CycleDays",
     DateAdd(
     LastVisit ,
     Value(CycleDays),
     TimeUnit.Days
     )
     )
     },
     Filter(
     _transformed_data,
     LastVisit_plus_CycleDays >= DatePicker1.SelectedDate
     )
    )
  • GigaenvyTAG69 Profile Picture
    67 on at

    Thanks man! I'll work a collection and dropdowns after I get base foundation working. You've been immense!

     

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard