change the background of a field according to its value

I want to dynamically change the background of a calculated field in a sharepoint list according to its value in the pulmsail form

Hello @achat,

Welcome to the Plumsail Community!

You can change the background of the Calculated field type using the code:

fd.spRendered(function() {
    if (fd.field('Field0').value == 'serious criticality') {
        $(fd.field('Field0').$el).css('background-color', 'red')
    } else if (fd.field('Field0').value == 'low criticality') {
        $(fd.field('Field0').$el).css('background-color', 'green')
    } else {
        $(fd.field('Field0').$el).css('background-color', 'yellow')
    }
});

Hello mnikitina
thank you for your reply

1 Like