Card change color based on value

Hello Helical Team,

I am using helical insight version 5.0 GA. What I have done is created card, I would like the values of the card to get changed based on the value of the data. How can that be done?

Thank You,
Netta.

Hello Helical Insight,

With the below code which can be put in “postfetch” of “Operatons” we can give different colors in case of different value

var result = data[0].Status
if(result >= 0 && result <= 20){
	properties.formatColor.formatColorField="0bda46ab-5b2f-44ea-b188-9af8a0ca36b2";
	properties.formatColor.formatColorStyle="fieldValue";
    properties.formatColor.defaultColor = {r: 255, g: 0, b: 0, a: 1};
	properties.card.suffixColor = {r: 255, g: 0, b: 0, a: 1};
	}
else if(result >= 21 && result <= 80){
	properties.formatColor.formatColorField="0bda46ab-5b2f-44ea-b188-9af8a0ca36b2";
	properties.formatColor.formatColorStyle="fieldValue";
    properties.formatColor.defaultColor = {r: 255, g: 255, b: 0, a: 1};
	properties.card.suffixColor = {r: 255, g: 255, b: 0, a: 1};
	}
else{
	properties.formatColor.formatColorField="0bda46ab-5b2f-44ea-b188-9af8a0ca36b2";
	properties.formatColor.formatColorStyle="fieldValue";
	properties.formatColor.defaultColor = {r: 0, g: 255, b: 0, a: 1};
	properties.card.suffixColor = {r: 255, g: 255, b: 0, a: 1};
}

Thank You,
Helical Insight.