I am trying to use nested if statements to color code the instance name in the Inbox. I have 4 cases that I need to check for:
CASE 1 - No Leak
If(string-length(${leak_id} = 0), concat('<font color="green"><b>', ${location_name}, '</b>', '</font>'), '')
CASE 2 - Leak Found and Not Repaired
If(string-length(${leak_id} > 0) and string-length(${leak_repair_date}=0), concat('<font color="red"><b>', ${location_name}, ‘ – NEEDS REPAIR’,'</b>', '</font>'), '')
CASE 3 - Leak Repaired and Not Re-Checked
If(string-length(${leak_id}>0) and string-length(${leak_repair_date}>0) and string-length(leak_recheck_date}=0), concat('<font color="orange"><b>', ${location_name}, ‘ – NEEDS RE-CHECK’,'</b>', '</font>'), '')
CASE 4 - Leak Repaired and Re-Checked
If(string-length(${leak_id}>0) and string-length(${leak_repair_date}>0) and string-length(leak_recheck_date}>0), concat('<font color="blue"><b>', ${location_name}, ‘ – LEAK REPAIRED & RE-CHECKED’,'</b>', '</font>'),'')
So, putting this all together gives me:
If(string-length(${leak_id}=0) , concat('<font color="green"><b>', ${location_name}, '</b>', '</font>'), If(string-length(${leak_id}>0) and string-length(${leak_repair_date} =0), concat('<font color="red"><b>', ${location_name}, ‘ – NEEDS REPAIR’,'</b>', '</font>'), If(string-length(${leak_id}>0) and string-length(${leak_repair_date} >0) and string-length(leak_recheck_date=0), concat('<font color="orange"><b>', ${location_name}, ‘ – NEEDS RE-CHECK’,'</b>', '</font>'), If(string-length(${leak_id}>0) and string-length(${leak_repair_date} >0) and string-length(leak_recheck_date}>0) ,concat('<font color="blue"><b>', ${location_name}, ‘ – LEAK REPAIRED & RE-CHECKED’,'</b>', '</font>', ‘’)))))
Can I use nested if/then for instance name and if yes, what am I missing??
Thanks,
--gary