Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask Salesforce Expert
Answered on Aug 5, 2021
Compiler is complaining about aura:if because you're using assignment (=) instead of conditional operator (==), in the second condition: (editMode='true'). Also you should know that AND function is case sensitive.
Second problem mentioned by Jayant would give a problem at run time.
You need to change:
isTrue="{!AND(v._candidateDetails.contact.Nationalite__c != null), (editMode='true'))}"to:
// not should if there is a typo as attribute _candidateDetails starts with an Underscore isTrue="{!and(v._candidateDetails.contact.Nationalite__c != null), (v.editMode=='true'))}"Ranjana Admin JanBask Expert Latest answer
Answered on Jun 14, 2024
In Salesforce's Aura components, the aura:if component is used to conditionally render content based on an expression. The isTrue attribute of aura:if accepts a boolean expression to determine whether the content inside should be rendered.
To handle multiple conditions, you can use logical operators (&& for AND, || for OR) within the isTrue parameter. Here’s how you can do it:
Using aura:if with Multiple Conditions
Example with AND Condition (&&)

Example with OR Condition (||)

Handling More Complex Conditions
You can also combine multiple conditions with both AND and OR logical operators. Make sure to use parentheses to group conditions correctly and ensure the logical operations are evaluated in the desired order.
Example with Complex Conditions

Practical Example
Here's a practical example that combines these concepts into a single Aura component.

Summary
These examples should help you implement complex conditional rendering in your Aura components using the aura:if component.
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step Salesforce guides from industry experts
Common Salesforce interview questions, answered
Guides, tips and career advice on Salesforce from JanBask experts.
Salesforce How to Become a Salesforce Administrator in 2027: A Step-by-Step Career Roadmap
Want to become a Salesforce Administrator? Get the complete 2026 roadmap skills, certification, salary & career path. Start your…
Salesforce Salesforce Admin Self Study vs Live Training: How to Choose the Right Path
Compare Salesforce Admin self-study and live training by cost, duration, flexibility, mentorship, and career support. Find the…
Salesforce How a Salesforce Admin Certification Shapes Your Career Growth
Wondering if a salesforce admin certification is worth it? See how it shapes hiring, salary, and long term salesforce admin…
Salesforce Salesforce Admin vs Developer Salary: Which Path Actually Pays More?
Salesforce admin vs developer salary: developers earn 15–25% more. See entry, mid and senior pay, why the gap exists, and how…