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 III
Super User III

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 III
Super User III

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (57,733)