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 Automate / Change Text Color base...
Power Automate
Answered

Change Text Color based on 3 Date values in Power Automate

(0) ShareShare
ReportReport
Posted on by 6

Requirements:

Create HTML Report from items that are expiring in 45 days and change the text color based on 3 date values.

 

Example:

Items expiring in 45 Days = Green.

Items that are expiring 30 Days = Orange

Items that are expiring 20 Days = Red

 

Issue:

The following Expression is working for two items. Can't seem to capture items expiring in 20 days. Need help on expanding this expression to include items expiring in 20 days (red)...Thanks

 

If (empty(item()?['EndDate']), '', if( lessOrEquals( item()?['EndDate'] , addDays(formatDateTime(utcNow(), 'yyyy-MM-dd'), 30, 'yyyy-MM-dd')),
concat('<span style="color:orange">', item()?['EndDate'], '</span>'),
concat('<span style="color:Green">', item()?['EndDate'])))

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @robayala 

     

    Please use the below expression:

     

    If (empty(item()?['EndDate']), '', if(lessOrEquals( item()?['EndDate'] , addDays(formatDateTime(utcNow(), 'yyyy-MM-dd'), 20, 'yyyy-MM-dd')),
    concat('<span style="color:red">', item()?['EndDate'], '</span>'),if( lessOrEquals( item()?['EndDate'], addDays(formatDateTime(utcNow(), 'yyyy-MM-dd'), 30, 'yyyy-MM-dd')),concat('<span style="color:orange">', item()?['EndDate'], '</span>'),concat('<span style="color:Green">', item()?['EndDate']))))

     

    Please let me know if you face any problem & remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • robayala Profile Picture
    6 on at

    @ManishSolanki 

    That worked! Awesome! Thank you so much for this and your quick reply. Have a great weekend.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 785

#2
Valantis Profile Picture

Valantis 669

#3
Haque Profile Picture

Haque 563

Last 30 days Overall leaderboard