+ Start a Discussion
Administrator 167Administrator 167 

Write a IF formula (>1) then display image + text

I would want to write a formula that uses a number from a roll-up summary field.
If this number > 1, then it should display an image AND display the number. If this number = 1, it should display another image and display "0".
I tried to mix a lot of possibilities from the formula below but did not found my way. 
Help would be appreciated

IF(Linked_Servers__c  > 1 , IMAGE("/img/samples/light_green.gif")+Linked_Servers__c) 
IF(Linked_Servers__c  = 1 , IMAGE("/img/samples/light_green.gif")+"0")
ANUTEJANUTEJ (Salesforce Developers) 
Hi there,

Have you tried checking conditional rendering as your scenario seems to the one that could use it, below if the link to the help article I found that explains how to make use of conditional rendering in visualforce page I hope you find the below article useful:

>> https://help.salesforce.com/articleView?id=000324662&type=1&mode=1

In case if this comes handy can you please choose this as best answer so that it can be used by others in  the future.

Administrator 167Administrator 167
I finally succeeded in this using formulas (containing images+value) included in formulas. 
ANUTEJANUTEJ (Salesforce Developers) 
Was the above link useful in case if it was can you please mark it as the best answer?
Administrator 167Administrator 167
@ANUTEJ No, it was not.
ANUTEJANUTEJ (Salesforce Developers) 
Sorry to see that the link was not helpful but as you have mentioned to execute a per a condition I thought this could come handy can you please mention the way you achieved and mark it as best solution so that it can be used by others in the future.
Administrator 167Administrator 167
I finally succeeded in this using formulas in Object A :

1) formula field 1 using roll-up summary of Object B
2) formula field 2 with "formula 1 - 1" (my specific need)
3) formula field 3 with image (green light) + formula field 2
4) formula field 4 with image (red light) + "0"
5) Formula field 5 with 

formula field 2 >= 1,
formula field 3,
formula field 4