cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vmn
Microsoft
Microsoft

Conditional formatting on List screen and details form

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

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

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.

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

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.

 

View solution in original post

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? 

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.

@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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,207)