[SalesForce] visualforce IF syntax

So I need to use an inline if statement in my visualforce page to decide whether or not I need to render an outputText. However I keep hitting a syntax error so I am hoping someone here will catch my (hopefully obvious) mistake.

So there is a field in my custom object that I want to print IF it is populated and not the Id of the contact page I am on. I am also iterating through a list of these objects. So here is what I wrote for an if statement

"{!IF({!relation.First_Contact__c} != null && {!relation.First_Contact__c} != contact.Id), true, false)"

again this is going in the rendered tag of an outputText so the returns are true or false. Also relation is the current custom object from the apex:repeat. Any help is MUCH appreciated.

Best Answer

"{!IF(AND(relation.First_Contact__c != null, relation.First_Contact__c != contact.Id), true, false)}"
Related Topic