How to change the background color for a column in list view based on condition?

gokulraj
Giga Expert

Hello Team,

I have a requirement to change the background colour field based on given condition.

 

find_real_file.png

 

As I highlighted above, If a word ends with ly , I want to show that column color as some green or red anything,

 

How to achieve this??

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use the Modern Cell Coloring option

uncheck that option from gear icon

apply style like this

1) left nav type field styles

2) create new

3) give your table

4) Select the field name

5) Value - give proper field name here

javascript: current.alphabets.endsWith('ly')

6) style - color: green

find_real_file.png

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use the Modern Cell Coloring option

uncheck that option from gear icon

apply style like this

1) left nav type field styles

2) create new

3) give your table

4) Select the field name

5) Value - give proper field name here

javascript: current.alphabets.endsWith('ly')

6) style - color: green

find_real_file.png

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

That's awesome. Thanks much

You are welcome

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar, how i use this rule, but condition other filed ? For ex, change back field Lenght, with same condition (javascript: current.alphabets.endsWith('ly')) ?