<aura:iteration items="{!v.contacts}" var="item" indexVar="idx">
  <aura:if isTrue="{!lessthan(idx,5)}"> 
        <ui:outputText value="{!ind}" />

Although, "contacts" list got more than 7 elements ... it never enters the Aura: If condition?

thanks If i remove " aura:if " condition 7 rows get populated.

  • could you please add your code - without code, we will not be able to assist. Jan 24, 2018 at 10:11

1 Answer 1


The bugs in your code is using <aura:if isTrue="{!lessthan(idx,5)}"> for lessthan use &lt; i.e):<aura:if isTrue="{!idx &lt; 2}">

Example Code:

<aura:application extends="force:slds">
<aura:iteration items="[1,2,3,4,5]" var="item" indexVar="idx">
  <aura:if isTrue="{!idx &lt; 2}"> 
        <ui:outputText value="{!item}" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.