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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Is it possible to change the colour of a field depending on the value?

(0) ShareShare
ReportReport
Posted on by

Hello everyone

We have a field in our database called Deceased which has values of either Yes or No as shown below:

pastedimage1663227763659v1.png

As you can see, the field is shown as black text on a white background. What I'd like to achieve is to change the value to show as white text on a red background if the value is Yes and remain as black text on a white background if the value is No.

When I click on the Edit box for the field in Customizations, I am able to change the hex colour value, but it doesn't seem to change anything on the form.

Any help would be much appreciated!

Many thanks
Jon

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    There is not supported way of changing field color, only unsupported options refer

    community.dynamics.com/.../need-change-the-colour-of-text-field-value-in-dynamics-365

  • MuhammadAnas Profile Picture
    15 on at

    To Change the field, background-color web resource and using this code. Inspect the id to get field id and select id

    if(document.getElementById("Select id of Field").value === "0")

    {

    document.getElementById("Your Field ID").style. background='yellow';

    }

    else{

    document.getElementById("Your Field ID").style. background='red';

    }

  • JonClay Profile Picture
    on at

    Thank you Mahendar Pal  I will try this out!

  • JonClay Profile Picture
    on at

    Thank you so much, I will take a look at doing this :)

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 Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans