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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Conditional formatting...
Power Apps
Answered

Conditional formatting on List screen and details form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have list screen, details & edit screen. For details & edit - I am using Edit & Display forms. Data I am showing has date field and if this date field value is 7 days less than current then want to apply some formatting to detail screen.

 

e.g. While loading list screen - if any of record date field value & current date difference is 7 days then want to show that record in red. Similarly when i navigate to Details screen - then date field data card color should be different & will also enable one button which is by default disable.

 

I have added below code to onVisible event of details screen but its not working

If(DateDiff(BrowseGallery3_2.Selected.'Expiry Date', Today()) = 7,'Expiry Date_DataCard1'.BorderColor=Red,btnBGCReminder.Visible=true)

 

Appreciate your help here.

 

Thanks,

Vivek

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    Hi @vmn ,

    On BorderColor of 'Expiry Date_DataCard1'

    If(
     DateDiff(
     BrowseGallery3_2.Selected.'Expiry Date', 
     Today()
     ) = 7,
     Red,
     Whatever it is now
    )

     

    On Visible of btnBGCReminder

    DateDiff(
     BrowseGallery3_2.Selected.'Expiry Date', 
     Today()
    ) = 7

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • vmn Profile Picture
    Microsoft Employee on at

    Thanks @WarrenBelz ,

    Button is working however On BorderColor of 'Expiry Date_DataCard1'  isnt.

    If(
     DateDiff(
     BrowseGallery3_2.Selected.'Expiry Date', 
     Today()
     ) = 7,
     Red,
     RGBA(0, 18, 107, 1)
    )

    Is it the case that some features didnt work as expected preview mode? 

  • vmn Profile Picture
    Microsoft Employee on at

    Well, figured it out. We need to make below change to make it work.

     

    Set Expiry Date_DataCard1 display mode to DisplayMode.Edit. Earlier it was read only.

    Thanks @WarrenBelz for the help.

  • WarrenBelz Profile Picture
    156,456 Most Valuable Professional on at

    @vmn ,

    You can also shortcut this a bit on this BorderColor

    If(
     btnBGCReminder.Visible,
     Red,
     RGBA(0, 18, 107, 1)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard