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
Vanitha ManiVanitha Mani 

lightning progressive indicator conditions

Hi i have progressive steps..based on the condition step 3 should display otherwise it should be skipped..

Condition is if Information_Request_Type__c field is 
BIS License Request,information,online support and some more values the step 3 should be skipped ..
Can anyone help me to write aura if condition with too many values.

<aura:if isTrue="{!v.ticket.Billable__c}">
                           
                           <lightning:progressStep label="Open Tasks" value="1" onclick="{!c.selectStep1}"/>
                                                       
                          
                            <lightning:progressStep label="Billing Details" value="2" onclick="{!c.selectStep2}"/>
                               
                           
                            <lightning:progressStep label="Work Time" value="3" onclick="{!c.selectStep3}"/>
                            
                            <lightning:progressStep label="Ticket Details" value="4" onclick="{!c.selectStep4}"/>
                            <lightning:progressStep label="KB/Problem" value="5" onclick="{!c.selectStep5}"/>
                               
                         <aura:set attribute="else">
                              
                            <lightning:progressStep label="Open Tasks" value="1" onclick="{!c.selectStep1}"/>
                  
                            <lightning:progressStep label="Work Time" value="3" onclick="{!c.selectStep3}"/>
                            
                            <lightning:progressStep label="Ticket Details" value="4" onclick="{!c.selectStep4}"/>
                            <lightning:progressStep label="KB/Problem" value="5" onclick="{!c.selectStep5}"/>
                              </aura:set>
                            </aura:if>
Maharajan CMaharajan C
Hi Vanitha,

There is no need of  <aura:set attribute="else"> in the above you can simplt write like below.

Try like below:
 
<lightning:progressStep label="Open Tasks" value="1" onclick="{!c.selectStep1}"/>
<aura:if isTrue="{!v.ticket.Billable__c}">
	<lightning:progressStep label="Billing Details" value="2" onclick="{!c.selectStep2}"/>
</aura:if>
<aura:if isTrue="{!!or(v.ticket.Information_Request_Type__c =='BIS License Request',v.ticket.Information_Request_Type__c=='online support',v.ticket.Information_Request_Type__c=='information')}">
	<lightning:progressStep label="Work Time" value="3" onclick="{!c.selectStep3}"/>
</aura:if>
<lightning:progressStep label="Ticket Details" value="4" onclick="{!c.selectStep4}"/>
<lightning:progressStep label="KB/Problem" value="5" onclick="{!c.selectStep5}"/>


Thanks,
Maharajan.C
Vanitha ManiVanitha Mani
Hi my controller is not working properly..Can u help with that?

var getselectedStep = component.get("v.currentStep");
 
) ;                        
 if(getselectedStep == "1" && component.get("v.ticket.Billable__c")){
           component.set("v.currentStep","2");
               
               }
         else if(getselectedStep == "1"){
             component.set("v.currentStep", "3"); 
         }
             

                          

           else if(getselectedStep == "2" && component.get("v.ticket.Information_Request_Type__c")){
            component.set("v.currentStep", "4");
              
              
        }
           
  else if(getselectedStep == "2"){
      component.set("v.currentStep", "3");
      event.preventDefault(); //Prevent default submit
        var eventFields = event.getParam("fields"); //get the fields
        
        component.find('leadCreateForm').submit(eventFields);
  }
        
     else if(getselectedStep == "3"){
            component.set("v.currentStep", "4");
           }
        else if(getselectedStep == "4"){
            component.set("v.currentStep", "5");
               event.preventDefault(); //Prevent default submit
        var eventFields1 = event.getParam("fields"); //get the fields
        
        component.find('leadCreateForm1').submit(eventFields1); 
           }
           
Maharajan CMaharajan C
what is the issue and Explain the issue breifly...

And also post the code properly or fully then i can easily help you.
Vanitha ManiVanitha Mani
Hi..

I have a next button which moves from one step to another..Based on aura conditions the next button should work..the indicator step is working fine but the content is not properly aligned.

                     <lightning:progressStep label="Open Tasks" value="1" onclick="{!c.selectStep1}"/>
                                                       
                          <aura:if isTrue="{!v.ticket.Billable__c}">

                            <lightning:progressStep label="Billing Details" value="2" onclick="{!c.selectStep2}"/>
                              </aura:if>
                           <aura:if isTrue="{!!or(v.ticket.Information_Request_Type__c =='BIS License Request',v.ticket.Information_Request_Type__c=='RSS Admin')}">
                            <lightning:progressStep label="Work Time" value="3" onclick="{!c.selectStep3}"/>
                            </aura:if>
                            <lightning:progressStep label="Ticket Details" value="4" onclick="{!c.selectStep4}"/>
                            <lightning:progressStep label="KB/Problem" value="5" onclick="{!c.selectStep5}"/>
                               
                        
                           
                        </lightning:progressIndicator>
 <lightning:button variant="brand" label="Next" onclick="{!c.handleNext }" aura:id="disableenable" disabled="false"/>
Here {!v.ticket.Billable__c} is true step 1 moves to step 2 if  not it should move to step 3
<aura:if isTrue="{!!or(v.ticket.Information_Request_Type__c =='BIS License Request',v.ticket.Information_Request_Type__c=='RSS Admin')}">
for this condition:step 2 moves to step 4 if not moves to step 3
 so these conditions didnt work properly when i click next button
next button controller code:
var getselectedStep = component.get("v.currentStep");
 
) ;                        
 if(getselectedStep == "1" && component.get("v.ticket.Billable__c")){
           component.set("v.currentStep","2");
               
               }
         else if(getselectedStep == "1"){
             component.set("v.currentStep", "3"); 
         }
             

                          

           else if(getselectedStep == "2" && component.get("v.ticket.Information_Request_Type__c")){
            component.set("v.currentStep", "4");
              
              
        }
           
  else if(getselectedStep == "2"){
      component.set("v.currentStep", "3");
      event.preventDefault(); //Prevent default submit
        var eventFields = event.getParam("fields"); //get the fields
        
        component.find('leadCreateForm').submit(eventFields);
  }
        
     else if(getselectedStep == "3"){
            component.set("v.currentStep", "4");
           }
        else if(getselectedStep == "4"){
            component.set("v.currentStep", "5");
               event.preventDefault(); //Prevent default submit
        var eventFields1 = event.getParam("fields"); //get the fields
        
        component.find('leadCreateForm1').submit(eventFields1); 
           }
           User-added image

and also how to validate fields ..required fields shouldnt be empty..now it submits the null value how to achieve it below.
User-added image

thanks