cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
neill_long
Resolver III
Resolver III

TemplateFill

Hello,

 

I am looking to add conditional formatting to my gallery.  I have the following formula on the TemplateFill of the gallery:

 

If(DateAdd(ThisItem.EV_Date, -1) = Today(), Red,
ThisItem.Students_Added_Check.Value = "Yes", Green)

 

Just now, if ThisItem.EV_Date minus 1 is equal to Todays date, then that record is highlighted Red.

 

However, If ThisItem.Students_Added_Check.Value equals Yes, then the record should highlight Green.

 

If none of the criteria is meet, then the record should not be highlighted.

 

It doesn't go green even though it is marked "Yes".

 

Any suggestions on how i can fix this please?

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
neill_long
Resolver III
Resolver III

I think i have figured this out, I have changed the formula to:

 

If(
    DateAdd(
        ThisItem.EV_Date,
        -1
    ) = Today() && ThisItem.Students_Added_Check.Value = "No",
    Red,
    DateAdd(
        ThisItem.EV_Date,
        -1
    ) = Today() && ThisItem.Students_Added_Check.Value = "Yes",
    Green,
    DateAdd(
        ThisItem.EV_Date,
        -1
    ) < Today() && ThisItem.Students_Added_Check.Value = "No",
    White
)

 

Seems to be working fine

View solution in original post

2 REPLIES 2
neill_long
Resolver III
Resolver III

I think i have figured this out, I have changed the formula to:

 

If(
    DateAdd(
        ThisItem.EV_Date,
        -1
    ) = Today() && ThisItem.Students_Added_Check.Value = "No",
    Red,
    DateAdd(
        ThisItem.EV_Date,
        -1
    ) = Today() && ThisItem.Students_Added_Check.Value = "Yes",
    Green,
    DateAdd(
        ThisItem.EV_Date,
        -1
    ) < Today() && ThisItem.Students_Added_Check.Value = "No",
    White
)

 

Seems to be working fine

v-yujincui-msft
Community Support
Community Support

Hi @neill_long ,

 

Congratulations!!!

 

Glad to see you figured it out.
Maybe you could consider marking your answer as a 'Solution' to close the case.

 

Best Regards,
Charlie Choi

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,040)