cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phineas
Post Partisan
Post Partisan

Gallery Item DateDiff

I there a way to run a date diff condition on a specifc item in a Gallery and its 'date'.

 

I have a Gallery. I have a Toggle.

 

In the Toggle default I have 

(CountRows(Fitler(Gallery.AllItems, Field1="Noncomplaint"))) =0 &&

(CountRows(Fitler(Gallery.AllItems, StartsWith(GalleryField.Text, "Title1"))) >0 &&

(CountRows(Fitler(Gallery.AllItems, StartsWith(GalleryField.Text, "Title2"))) >0 &&

(CountRows(Fitler(Gallery.AllItems, StartsWith(GalleryField.Text, "Title3"))) >0 - from this point I need the specific date of issue

                                                                                                                              associated with Title3 compared to Today; if date

                                                                                                                              of issue greater than Today Toggle 'true'  

2 REPLIES 2
rubin_boer
Super User
Super User

hi @Phineas It seems you have two requirements; the toggle and gallery are two controls in the canvas and based on the gallery the toggle needs to be true or false:

req 1: overall compliance and then

req 2: which item is causing the noncompliance? 

 

req1:

//compliance is either true or false

CountRows(Filter(YourGallery.AllItems,DateDiff(Today(), YourDateColumn, Days)<0))

 

req 2:

If(
    And(
        ThisItem.Field1="Noncompliant", 
        "Title1" in ThisItem.Text, 
        "Title2" in ThisItem.Text, 
        "Title3" in ThisItem.Text,
        DATEDIFF(Today(),YourDateValue,Days) < 0
        )
    ,"Noncompliant"
    ,"Compliant"
)

 

 

Edited Reply:

 

Thank you.

 

Let's make sure we are on the same page.

 

1. The Gallery needs to display ALL records, not just all 'Compliant' or 'Noncompliant'

2. Gallery MUST contain AT LEAST either

    - Title1 - Title4; and, Title4 can be no more than two years old

      or

    - Title1 - 5; and, Title5 can be no more than two years old

With you method would I not also need to factor in the difference periodicities of each, yes?

 

Some Titles are good for 365 days, some 730, some 1095.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,613)