+ Start a Discussion
rajaraja 

How to use Image in Formula field ?

Hello All,

I  have one of the formula field called " Case status" .  "Case status is a formula field " will update green,red ,yellow icon  . Now  I have requirement like , based on "Case status"(Formula Field) and case "Type"(Picklist) field , i need to create another formula field . How can i achecive this ?

For example : If  Case status = "Green" Icon and Type ="Other" then case violation ="Low"
                         Case status ="Yellow" Icon and Type =""structural" then case Violation ="Medium"
                         Case status ="Red" Icon and  Type =" Electrical" then case violation ="High"

How can i achecive this ?

Regards,
Raja.
Best Answer chosen by raja
yogesh_sharmayogesh_sharma

Hello Raja,

You are using ISPICKVAl, which is use for comparison.

Just try this code:

IF(AND((text(Industry)=='Banking'),AnnualRevenue>=1000), 'low', IF(AND((text(Industry)=='Energy'),AnnualRevenue<=100), 'Medium', 'High'))

I hope it helps you. Please mark this answer as best answer if it helps you, so that it will be easily searchable for others.

Thanks,

Yogesh Sharma

All Answers

sfdcMonkey.comsfdcMonkey.com
hi Raja
go to below link for know that how to use image in formula field
https://help.salesforce.com/articleView?id=000007604&language=en_US&type=1
let me inform if it helps you
thanks
yogesh_sharmayogesh_sharma

Hello Raja,

Here you don't need to fetch value from formula field. Below are my solution related to this:

You have created one formula field called "Case Status" based on some filter that display green,red,yellow icons. So you can create another formula field with the same filter criteria and add one more criteria of Type if that match then can update Case Violation. Below are the examples of this:

Field Name : Case Status (Formula field)

Case Status = If(XYZfieldValue == "A", "Green")

Case Status = If(XYZfieldValue == "B", "Yellow")

Case Status = If(XYZfieldValue == "C", "Red")

Another Field which you want to create: Case Violation (Formula Field)

Case Violation = If(AND(XYZfieldValue == "A", Type == 'Other' ) , 'Low', 'some other value') 

Case Violation = If(AND(XYZfieldValue == "B", Type == 'structural' ) , 'Medium', 'some other value') 

Case Violation = If(AND(XYZfieldValue == "C", Type == 'Electrical' ) , 'High', 'some other value') 

Because if you will build case Violation formula based on Icon that is the same thing I am doing here. That Icon will be visible based on some condition and you can apply the same condition in another formula.

I hope it helps you. Please mark this as best answer if it helps you.

Thanks,

Yogesh Sharma

rajaraja
Hello Piyush,

Thanks for your reply . Here my requiremnt was different .
rajaraja
Hello Yogesh,
As per your comment i tried in my own login . i got error message  like below . 

Error: Field Industry is a picklist field. Picklist fields are only supported in certain functions. 

Formula : IF(( AnnualRevenue>= 1000 && ISPICKVAL(Industry =='Banking')),"Low" , IF ( AND(AnnualRevenue <= 100, ISPICKVAL(Industry =='Energy')),'Medium', 'Medium','High'))

Can you help me on this .
yogesh_sharmayogesh_sharma

Hello Raja,

You are using ISPICKVAl, which is use for comparison.

Just try this code:

IF(AND((text(Industry)=='Banking'),AnnualRevenue>=1000), 'low', IF(AND((text(Industry)=='Energy'),AnnualRevenue<=100), 'Medium', 'High'))

I hope it helps you. Please mark this answer as best answer if it helps you, so that it will be easily searchable for others.

Thanks,

Yogesh Sharma

This was selected as the best answer
rajaraja
Thank you Yogesh. It works perfectly fine .