function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark GallagherMark Gallagher 

Hey can't figure out why I'm getting an error for this trying to do IF AND statement in a lightning component

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <aura:attribute name="Lead" type="Lead"/>
    <aura:if isTrue="{!and(v.Lead.pi__score__c != 0, v.Lead.Email = "darkknight@theherogothamneeds.com")}">
        <p>    one step closer</p>
    <aura:set attribute="else">
        <p> still one step closer</p>
       </aura:set>
    </aura:if>
</aura:component>
Raj VakatiRaj Vakati
Try like below
 
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <aura:attribute name="leads" type="Lead"  default="{'sobjectType':'Lead', 'Email':'darkknigh1t@theherogothamneeds.com' , 'pi__score__c':10}"/>
    
    
    <aura:if isTrue="{!and(v.leads.pi__score__c ne 0, v.leads.Email ne 'darkknight@theherogothamneeds.com')}">
        
        
        
        <p>    IF one step closer</p>
        <aura:set attribute="else">
            {!v.leads.pi__score__c}
            <p> ELSE still one step closer</p>
        </aura:set>
    </aura:if>
</aura:component>


 
Mark GallagherMark Gallagher
This stopped me from getting a Syntax error, but when I added to my Lightning page I'm getting logic errors I purposefully made the emails not match, but it's still giving me the print statement for a true condition.