I want to do a simple thing. Based on the value of an item, I wish to change the formatting of another item.

Like for example, if my checking item is say 'Confirmed', and if 'Confirmed is 1, the format the Status item as green, and if not then make it red.

My problem is that it works only when status has changed. In other words, the formatting applies to the status item only when the value of status item has changed from before.

Heres some code...

Data.onItemUpdate = updateItem;
Data.onChangingValues = formatValues;

//....

function formatValues(item, itemUpdate)
{
///...

if(itemUpdate.getServerValue("Confirmed") == "1")
{
itemUpdate.setAttribute("ItemStatusField" ,ColorNeutral, ColorPositive,"backgroundColor");
}
}

In the above code... the colors change only if the value of "ItemStatusField" has changed in the current update.

Why is it like this? What do I do?

Thanks in advance!!
WK
Indeed, the change of the cell content related to a field is driven by the formatted value assigned to the field.
By convention, if a field value doesn't change, it gets a default formatted value of null, which means that the cell should not change on the screen; in this case, the "setAttribute" call is ignored (this probably turns out to be a misleading convention).

You can enforce the cell change by reassigning the formatted value for the field,
which you could have cached,
or could recompute, based on the current server value, as returned by "getServerValue" (that is always valued, even for unchanged fields).

See the setFormattedValue jsdoc.