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

Notifications

Announcements

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
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard