Need to iterate 2values inside single aura:iteration



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite
1












I want to iterate 2values inside a single aura:iteration. But I am not able to do so. Can ayone help me in this. I am able to get value for "v.opportunityStages" but for "v.opportunityPath" nothing is coming. My JSON response is below. enter image description here.
I have given below my code.



Method 1:
My component code :



<aura:attribute name="opportunityStages" type="List" />
<aura:attribute name="opportunityPath" type="List" />
<aura:handler name="init" value="!this" action="!c.doInit" />
<aura:attribute name = "opportunityStagePath" type="Object" default=""/>
<aura:iteration items="!v.opportunityStages" var="item">
<li class="! 'slds-path__item ' + (opportunityPath)" role="presentation">
<a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
<p> !item</p>
</a>
</li>
</aura:iteration>


My Controller JS



doInit: function(component, event, helper)

var dto = "opportunityId" : '0064E000007QBNg';
var action = component.get("c.searchOpportunity");
action.setParams(
"opportunityDto": JSON.stringify(dto)
);
action.setCallback(this, function(response)
if (state === "SUCCESS")
try
var result = JSON.parse(response.getReturnValue());
alert(" unparsed json : +response.getReturnValue());
component.set('v.opportunityStages',result.opportunityStage);
component.set('v.opportunityPath',result.opportunityPath);
catch(e)
helper.handleJSException(component,response);

else
helper.handleAuraException(component,response);

);
$A.enqueueAction(action);



Along with the above method, I tried one more way



Method 2:
Component Code:



 <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
<aura:iteration items="!v.opportunityStagePath" var="item">
<li class="! 'slds-path__item ' + (item.opportunityPath)" role="presentation">
<a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
<p> !item.opportunityStage</p>
</a>
</li>
</aura:iteration>


Controller Code



 action.setCallback(this, function(response) 

var state = response.getState();
if (state === "SUCCESS")
try
var result = JSON.parse(response.getReturnValue());
component.set('v.opportunityStagePath',result);
)
catch(e)
helper.handleJSException(component,response);


});



@itzmukeshy7, My updated code as per your idea:



My component



<aura:handler name="init" value="!this" action="!c.doInit" />
<aura:attribute name="opportunityStages" type="List" />
<aura:attribute name="opportunityPath" type="List" />
<aura:attribute name = "opportunityStagePath" type="Object" default=""/>
<aura:attribute name = "opportunityStageNPath" type="List" default="" />
<div class="slds-path">
<div class="slds-grid slds-path__track">
<div class="slds-grid slds-path__scroller-container">
<div class="slds-path__scroller" role="application">
<div class="slds-path__scroller_inner">
<ul class="slds-path__nav" role="listbox" aria-orientation="horizontal">
<aura:iteration items="!v.opportunityStageNPath" var="opportunity">
<li class="slds-path__item slds-is-won" role="presentation">

<a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">


<p> !opportunity.stage</p>

</a>
</li>
</aura:iteration>
</ul>
</div>
</div>
</div>
</div>
</div>


My Controller



(doInit: function(component, event, helper)

var dto = "opportunityId" : '0064E000007QBNg';
var action = component.get("c.searchOpportunity");
action.setParams(
"opportunityDto": JSON.stringify(dto)
);

action.setCallback(this, function(response)

var state = response.getState();
if (state === "SUCCESS")
alert("state : "+state);
try
var result = JSON.parse(response.getReturnValue());

component.set('v.opportunityStages',result.opportunityStage);
component.set('v.opportunityPath',result.opportunityPath);
/* create list of opportunity stages and paths */
var opportunityStateNPath = ;
result.opportunityStage.forEach(function (stage, index)
opportunityStateNPath.push( stage: stage, path: result.opportunityPath[index] );
)
component.set('v.opportunityStateNPath', opportunityStateNPath);

catch(e)
helper.handleJSException(component,response);

else alert("state : "+state);
helper.handleAuraException(component,response);


);

$A.enqueueAction(action);


)









share|improve this question





























    up vote
    2
    down vote

    favorite
    1












    I want to iterate 2values inside a single aura:iteration. But I am not able to do so. Can ayone help me in this. I am able to get value for "v.opportunityStages" but for "v.opportunityPath" nothing is coming. My JSON response is below. enter image description here.
    I have given below my code.



    Method 1:
    My component code :



    <aura:attribute name="opportunityStages" type="List" />
    <aura:attribute name="opportunityPath" type="List" />
    <aura:handler name="init" value="!this" action="!c.doInit" />
    <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
    <aura:iteration items="!v.opportunityStages" var="item">
    <li class="! 'slds-path__item ' + (opportunityPath)" role="presentation">
    <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
    <p> !item</p>
    </a>
    </li>
    </aura:iteration>


    My Controller JS



    doInit: function(component, event, helper)

    var dto = "opportunityId" : '0064E000007QBNg';
    var action = component.get("c.searchOpportunity");
    action.setParams(
    "opportunityDto": JSON.stringify(dto)
    );
    action.setCallback(this, function(response)
    if (state === "SUCCESS")
    try
    var result = JSON.parse(response.getReturnValue());
    alert(" unparsed json : +response.getReturnValue());
    component.set('v.opportunityStages',result.opportunityStage);
    component.set('v.opportunityPath',result.opportunityPath);
    catch(e)
    helper.handleJSException(component,response);

    else
    helper.handleAuraException(component,response);

    );
    $A.enqueueAction(action);



    Along with the above method, I tried one more way



    Method 2:
    Component Code:



     <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
    <aura:iteration items="!v.opportunityStagePath" var="item">
    <li class="! 'slds-path__item ' + (item.opportunityPath)" role="presentation">
    <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
    <p> !item.opportunityStage</p>
    </a>
    </li>
    </aura:iteration>


    Controller Code



     action.setCallback(this, function(response) 

    var state = response.getState();
    if (state === "SUCCESS")
    try
    var result = JSON.parse(response.getReturnValue());
    component.set('v.opportunityStagePath',result);
    )
    catch(e)
    helper.handleJSException(component,response);


    });



    @itzmukeshy7, My updated code as per your idea:



    My component



    <aura:handler name="init" value="!this" action="!c.doInit" />
    <aura:attribute name="opportunityStages" type="List" />
    <aura:attribute name="opportunityPath" type="List" />
    <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
    <aura:attribute name = "opportunityStageNPath" type="List" default="" />
    <div class="slds-path">
    <div class="slds-grid slds-path__track">
    <div class="slds-grid slds-path__scroller-container">
    <div class="slds-path__scroller" role="application">
    <div class="slds-path__scroller_inner">
    <ul class="slds-path__nav" role="listbox" aria-orientation="horizontal">
    <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
    <li class="slds-path__item slds-is-won" role="presentation">

    <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">


    <p> !opportunity.stage</p>

    </a>
    </li>
    </aura:iteration>
    </ul>
    </div>
    </div>
    </div>
    </div>
    </div>


    My Controller



    (doInit: function(component, event, helper)

    var dto = "opportunityId" : '0064E000007QBNg';
    var action = component.get("c.searchOpportunity");
    action.setParams(
    "opportunityDto": JSON.stringify(dto)
    );

    action.setCallback(this, function(response)

    var state = response.getState();
    if (state === "SUCCESS")
    alert("state : "+state);
    try
    var result = JSON.parse(response.getReturnValue());

    component.set('v.opportunityStages',result.opportunityStage);
    component.set('v.opportunityPath',result.opportunityPath);
    /* create list of opportunity stages and paths */
    var opportunityStateNPath = ;
    result.opportunityStage.forEach(function (stage, index)
    opportunityStateNPath.push( stage: stage, path: result.opportunityPath[index] );
    )
    component.set('v.opportunityStateNPath', opportunityStateNPath);

    catch(e)
    helper.handleJSException(component,response);

    else alert("state : "+state);
    helper.handleAuraException(component,response);


    );

    $A.enqueueAction(action);


    )









    share|improve this question

























      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      I want to iterate 2values inside a single aura:iteration. But I am not able to do so. Can ayone help me in this. I am able to get value for "v.opportunityStages" but for "v.opportunityPath" nothing is coming. My JSON response is below. enter image description here.
      I have given below my code.



      Method 1:
      My component code :



      <aura:attribute name="opportunityStages" type="List" />
      <aura:attribute name="opportunityPath" type="List" />
      <aura:handler name="init" value="!this" action="!c.doInit" />
      <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
      <aura:iteration items="!v.opportunityStages" var="item">
      <li class="! 'slds-path__item ' + (opportunityPath)" role="presentation">
      <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
      <p> !item</p>
      </a>
      </li>
      </aura:iteration>


      My Controller JS



      doInit: function(component, event, helper)

      var dto = "opportunityId" : '0064E000007QBNg';
      var action = component.get("c.searchOpportunity");
      action.setParams(
      "opportunityDto": JSON.stringify(dto)
      );
      action.setCallback(this, function(response)
      if (state === "SUCCESS")
      try
      var result = JSON.parse(response.getReturnValue());
      alert(" unparsed json : +response.getReturnValue());
      component.set('v.opportunityStages',result.opportunityStage);
      component.set('v.opportunityPath',result.opportunityPath);
      catch(e)
      helper.handleJSException(component,response);

      else
      helper.handleAuraException(component,response);

      );
      $A.enqueueAction(action);



      Along with the above method, I tried one more way



      Method 2:
      Component Code:



       <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
      <aura:iteration items="!v.opportunityStagePath" var="item">
      <li class="! 'slds-path__item ' + (item.opportunityPath)" role="presentation">
      <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
      <p> !item.opportunityStage</p>
      </a>
      </li>
      </aura:iteration>


      Controller Code



       action.setCallback(this, function(response) 

      var state = response.getState();
      if (state === "SUCCESS")
      try
      var result = JSON.parse(response.getReturnValue());
      component.set('v.opportunityStagePath',result);
      )
      catch(e)
      helper.handleJSException(component,response);


      });



      @itzmukeshy7, My updated code as per your idea:



      My component



      <aura:handler name="init" value="!this" action="!c.doInit" />
      <aura:attribute name="opportunityStages" type="List" />
      <aura:attribute name="opportunityPath" type="List" />
      <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
      <aura:attribute name = "opportunityStageNPath" type="List" default="" />
      <div class="slds-path">
      <div class="slds-grid slds-path__track">
      <div class="slds-grid slds-path__scroller-container">
      <div class="slds-path__scroller" role="application">
      <div class="slds-path__scroller_inner">
      <ul class="slds-path__nav" role="listbox" aria-orientation="horizontal">
      <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
      <li class="slds-path__item slds-is-won" role="presentation">

      <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">


      <p> !opportunity.stage</p>

      </a>
      </li>
      </aura:iteration>
      </ul>
      </div>
      </div>
      </div>
      </div>
      </div>


      My Controller



      (doInit: function(component, event, helper)

      var dto = "opportunityId" : '0064E000007QBNg';
      var action = component.get("c.searchOpportunity");
      action.setParams(
      "opportunityDto": JSON.stringify(dto)
      );

      action.setCallback(this, function(response)

      var state = response.getState();
      if (state === "SUCCESS")
      alert("state : "+state);
      try
      var result = JSON.parse(response.getReturnValue());

      component.set('v.opportunityStages',result.opportunityStage);
      component.set('v.opportunityPath',result.opportunityPath);
      /* create list of opportunity stages and paths */
      var opportunityStateNPath = ;
      result.opportunityStage.forEach(function (stage, index)
      opportunityStateNPath.push( stage: stage, path: result.opportunityPath[index] );
      )
      component.set('v.opportunityStateNPath', opportunityStateNPath);

      catch(e)
      helper.handleJSException(component,response);

      else alert("state : "+state);
      helper.handleAuraException(component,response);


      );

      $A.enqueueAction(action);


      )









      share|improve this question















      I want to iterate 2values inside a single aura:iteration. But I am not able to do so. Can ayone help me in this. I am able to get value for "v.opportunityStages" but for "v.opportunityPath" nothing is coming. My JSON response is below. enter image description here.
      I have given below my code.



      Method 1:
      My component code :



      <aura:attribute name="opportunityStages" type="List" />
      <aura:attribute name="opportunityPath" type="List" />
      <aura:handler name="init" value="!this" action="!c.doInit" />
      <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
      <aura:iteration items="!v.opportunityStages" var="item">
      <li class="! 'slds-path__item ' + (opportunityPath)" role="presentation">
      <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
      <p> !item</p>
      </a>
      </li>
      </aura:iteration>


      My Controller JS



      doInit: function(component, event, helper)

      var dto = "opportunityId" : '0064E000007QBNg';
      var action = component.get("c.searchOpportunity");
      action.setParams(
      "opportunityDto": JSON.stringify(dto)
      );
      action.setCallback(this, function(response)
      if (state === "SUCCESS")
      try
      var result = JSON.parse(response.getReturnValue());
      alert(" unparsed json : +response.getReturnValue());
      component.set('v.opportunityStages',result.opportunityStage);
      component.set('v.opportunityPath',result.opportunityPath);
      catch(e)
      helper.handleJSException(component,response);

      else
      helper.handleAuraException(component,response);

      );
      $A.enqueueAction(action);



      Along with the above method, I tried one more way



      Method 2:
      Component Code:



       <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
      <aura:iteration items="!v.opportunityStagePath" var="item">
      <li class="! 'slds-path__item ' + (item.opportunityPath)" role="presentation">
      <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
      <p> !item.opportunityStage</p>
      </a>
      </li>
      </aura:iteration>


      Controller Code



       action.setCallback(this, function(response) 

      var state = response.getState();
      if (state === "SUCCESS")
      try
      var result = JSON.parse(response.getReturnValue());
      component.set('v.opportunityStagePath',result);
      )
      catch(e)
      helper.handleJSException(component,response);


      });



      @itzmukeshy7, My updated code as per your idea:



      My component



      <aura:handler name="init" value="!this" action="!c.doInit" />
      <aura:attribute name="opportunityStages" type="List" />
      <aura:attribute name="opportunityPath" type="List" />
      <aura:attribute name = "opportunityStagePath" type="Object" default=""/>
      <aura:attribute name = "opportunityStageNPath" type="List" default="" />
      <div class="slds-path">
      <div class="slds-grid slds-path__track">
      <div class="slds-grid slds-path__scroller-container">
      <div class="slds-path__scroller" role="application">
      <div class="slds-path__scroller_inner">
      <ul class="slds-path__nav" role="listbox" aria-orientation="horizontal">
      <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
      <li class="slds-path__item slds-is-won" role="presentation">

      <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">


      <p> !opportunity.stage</p>

      </a>
      </li>
      </aura:iteration>
      </ul>
      </div>
      </div>
      </div>
      </div>
      </div>


      My Controller



      (doInit: function(component, event, helper)

      var dto = "opportunityId" : '0064E000007QBNg';
      var action = component.get("c.searchOpportunity");
      action.setParams(
      "opportunityDto": JSON.stringify(dto)
      );

      action.setCallback(this, function(response)

      var state = response.getState();
      if (state === "SUCCESS")
      alert("state : "+state);
      try
      var result = JSON.parse(response.getReturnValue());

      component.set('v.opportunityStages',result.opportunityStage);
      component.set('v.opportunityPath',result.opportunityPath);
      /* create list of opportunity stages and paths */
      var opportunityStateNPath = ;
      result.opportunityStage.forEach(function (stage, index)
      opportunityStateNPath.push( stage: stage, path: result.opportunityPath[index] );
      )
      component.set('v.opportunityStateNPath', opportunityStateNPath);

      catch(e)
      helper.handleJSException(component,response);

      else alert("state : "+state);
      helper.handleAuraException(component,response);


      );

      $A.enqueueAction(action);


      )






      lightning-components lightning-experience lightning-community






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 23 at 17:00









      Adrian Larson

      103k19110233




      103k19110233










      asked Aug 23 at 5:16









      Aruna

      118114




      118114




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote













          each variable within your opportunityStages collection was declared as item,



          so your approach should be !item.opportunityPath to access it in your iteration.






          share|improve this answer




















          • I tried this logic but no success.
            – Aruna
            Aug 23 at 5:39










          • you might want to update your post with how you are trying and what isint working
            – glls
            Aug 23 at 5:40

















          up vote
          1
          down vote













          Here you can create a wrapper for both List and then pass that wrapper list in Lightning.



          Then you can refer both list simultaneously.



          <aura:iteration items="!v.opportunitywrapper" var="item">
          <aura:iteration items="!item.opportunityPath" var="item1">


          </aura:iteration>
          <aura:iteration items="!item.opportunityStages" var="item2">


          </aura:iteration>

          </aura:iteration>





          share|improve this answer




















          • This solution won't work.
            – Aruna
            Aug 23 at 5:38










          • @Aruna are you facing any issue. Please explain a bit.
            – Tushar Sharma
            Aug 23 at 5:40










          • I have updated my question, please take a look
            – Aruna
            Aug 23 at 6:34










          • @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
            – Tushar Sharma
            Aug 23 at 6:47










          • I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
            – Aruna
            Aug 23 at 6:59

















          up vote
          1
          down vote













          Actually, we can do that, here you can take help of Map like:



          Component code



          <aura:attribute name="opportunityStages" type="List" />
          <aura:attribute name="opportunityPath" type="List" />
          <aura:handler name="init" value="!this" action="!c.doInit" />
          <aura:attribute name = "opportunityStagePath" type="Object" default="" />
          <aura:attribute name = "opportunityStageNPath" type="List" default="" />


          <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
          <li class="!'slds-path__item ' + (equals(opportunity.path, 'Proposition/Nego') ? 'slds-is-active' : 'slds-is-incomplete')" role="presentation">
          <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
          <p> !opportunity.stage</p>
          </a>
          </li>
          </aura:iteration>


          JS Controller logic



          doInit: function(component, event, helper) 
          var dto = "opportunityId": '0064E000007QBNg' ;
          var action = component.get("c.searchOpportunity");
          action.setParams(
          "opportunityDto": JSON.stringify(dto)
          );
          action.setCallback(this, function (response)
          if (state === "SUCCESS")
          try
          var result = JSON.parse(response.getReturnValue());
          alert(response.getReturnValue());
          component.set('v.opportunityStages', result.opportunityStage);
          component.set('v.opportunityPath', result.opportunityPath);

          /* create list of opportunity stages and paths */
          var opportunityStateNPath = ;
          result.opportunityStage.forEach(function (stage, index)
          opportunityStateNPath.push();
          )
          component.set('v.opportunityStateNPath', opportunityStateNPath);

          catch (e)
          helper.handleJSException(component, response);

          else
          helper.handleAuraException(component, response);

          );
          $A.enqueueAction(action);






          share|improve this answer




















          • Its not working for me
            – Aruna
            Aug 23 at 5:38










          • Are you getting any errors?
            – itzmukeshy7
            Aug 23 at 5:39










          • the page is loading without the iteration part.
            – Aruna
            Aug 23 at 5:40










          • Can you share the updated code, what you are trying now?
            – itzmukeshy7
            Aug 23 at 5:41










          • I have added my updated code below as answer, Plz check that
            – Aruna
            Aug 23 at 5:47











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "459"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f229856%2fneed-to-iterate-2values-inside-single-auraiteration%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          each variable within your opportunityStages collection was declared as item,



          so your approach should be !item.opportunityPath to access it in your iteration.






          share|improve this answer




















          • I tried this logic but no success.
            – Aruna
            Aug 23 at 5:39










          • you might want to update your post with how you are trying and what isint working
            – glls
            Aug 23 at 5:40














          up vote
          1
          down vote













          each variable within your opportunityStages collection was declared as item,



          so your approach should be !item.opportunityPath to access it in your iteration.






          share|improve this answer




















          • I tried this logic but no success.
            – Aruna
            Aug 23 at 5:39










          • you might want to update your post with how you are trying and what isint working
            – glls
            Aug 23 at 5:40












          up vote
          1
          down vote










          up vote
          1
          down vote









          each variable within your opportunityStages collection was declared as item,



          so your approach should be !item.opportunityPath to access it in your iteration.






          share|improve this answer












          each variable within your opportunityStages collection was declared as item,



          so your approach should be !item.opportunityPath to access it in your iteration.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 23 at 5:26









          glls

          10.5k62047




          10.5k62047











          • I tried this logic but no success.
            – Aruna
            Aug 23 at 5:39










          • you might want to update your post with how you are trying and what isint working
            – glls
            Aug 23 at 5:40
















          • I tried this logic but no success.
            – Aruna
            Aug 23 at 5:39










          • you might want to update your post with how you are trying and what isint working
            – glls
            Aug 23 at 5:40















          I tried this logic but no success.
          – Aruna
          Aug 23 at 5:39




          I tried this logic but no success.
          – Aruna
          Aug 23 at 5:39












          you might want to update your post with how you are trying and what isint working
          – glls
          Aug 23 at 5:40




          you might want to update your post with how you are trying and what isint working
          – glls
          Aug 23 at 5:40












          up vote
          1
          down vote













          Here you can create a wrapper for both List and then pass that wrapper list in Lightning.



          Then you can refer both list simultaneously.



          <aura:iteration items="!v.opportunitywrapper" var="item">
          <aura:iteration items="!item.opportunityPath" var="item1">


          </aura:iteration>
          <aura:iteration items="!item.opportunityStages" var="item2">


          </aura:iteration>

          </aura:iteration>





          share|improve this answer




















          • This solution won't work.
            – Aruna
            Aug 23 at 5:38










          • @Aruna are you facing any issue. Please explain a bit.
            – Tushar Sharma
            Aug 23 at 5:40










          • I have updated my question, please take a look
            – Aruna
            Aug 23 at 6:34










          • @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
            – Tushar Sharma
            Aug 23 at 6:47










          • I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
            – Aruna
            Aug 23 at 6:59














          up vote
          1
          down vote













          Here you can create a wrapper for both List and then pass that wrapper list in Lightning.



          Then you can refer both list simultaneously.



          <aura:iteration items="!v.opportunitywrapper" var="item">
          <aura:iteration items="!item.opportunityPath" var="item1">


          </aura:iteration>
          <aura:iteration items="!item.opportunityStages" var="item2">


          </aura:iteration>

          </aura:iteration>





          share|improve this answer




















          • This solution won't work.
            – Aruna
            Aug 23 at 5:38










          • @Aruna are you facing any issue. Please explain a bit.
            – Tushar Sharma
            Aug 23 at 5:40










          • I have updated my question, please take a look
            – Aruna
            Aug 23 at 6:34










          • @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
            – Tushar Sharma
            Aug 23 at 6:47










          • I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
            – Aruna
            Aug 23 at 6:59












          up vote
          1
          down vote










          up vote
          1
          down vote









          Here you can create a wrapper for both List and then pass that wrapper list in Lightning.



          Then you can refer both list simultaneously.



          <aura:iteration items="!v.opportunitywrapper" var="item">
          <aura:iteration items="!item.opportunityPath" var="item1">


          </aura:iteration>
          <aura:iteration items="!item.opportunityStages" var="item2">


          </aura:iteration>

          </aura:iteration>





          share|improve this answer












          Here you can create a wrapper for both List and then pass that wrapper list in Lightning.



          Then you can refer both list simultaneously.



          <aura:iteration items="!v.opportunitywrapper" var="item">
          <aura:iteration items="!item.opportunityPath" var="item1">


          </aura:iteration>
          <aura:iteration items="!item.opportunityStages" var="item2">


          </aura:iteration>

          </aura:iteration>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 23 at 5:28









          Tushar Sharma

          24.1k52147




          24.1k52147











          • This solution won't work.
            – Aruna
            Aug 23 at 5:38










          • @Aruna are you facing any issue. Please explain a bit.
            – Tushar Sharma
            Aug 23 at 5:40










          • I have updated my question, please take a look
            – Aruna
            Aug 23 at 6:34










          • @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
            – Tushar Sharma
            Aug 23 at 6:47










          • I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
            – Aruna
            Aug 23 at 6:59
















          • This solution won't work.
            – Aruna
            Aug 23 at 5:38










          • @Aruna are you facing any issue. Please explain a bit.
            – Tushar Sharma
            Aug 23 at 5:40










          • I have updated my question, please take a look
            – Aruna
            Aug 23 at 6:34










          • @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
            – Tushar Sharma
            Aug 23 at 6:47










          • I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
            – Aruna
            Aug 23 at 6:59















          This solution won't work.
          – Aruna
          Aug 23 at 5:38




          This solution won't work.
          – Aruna
          Aug 23 at 5:38












          @Aruna are you facing any issue. Please explain a bit.
          – Tushar Sharma
          Aug 23 at 5:40




          @Aruna are you facing any issue. Please explain a bit.
          – Tushar Sharma
          Aug 23 at 5:40












          I have updated my question, please take a look
          – Aruna
          Aug 23 at 6:34




          I have updated my question, please take a look
          – Aruna
          Aug 23 at 6:34












          @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
          – Tushar Sharma
          Aug 23 at 6:47




          @Aruna opportunityPath is a list so you need aura:iteration to iterate it. You can't directly access it.
          – Tushar Sharma
          Aug 23 at 6:47












          I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
          – Aruna
          Aug 23 at 6:59




          I have a tag '<li>' for which I am applying style and then displaying a dynamic data inside that tag. How can I do that with 2iteration sets? It will spoil the logic right?
          – Aruna
          Aug 23 at 6:59










          up vote
          1
          down vote













          Actually, we can do that, here you can take help of Map like:



          Component code



          <aura:attribute name="opportunityStages" type="List" />
          <aura:attribute name="opportunityPath" type="List" />
          <aura:handler name="init" value="!this" action="!c.doInit" />
          <aura:attribute name = "opportunityStagePath" type="Object" default="" />
          <aura:attribute name = "opportunityStageNPath" type="List" default="" />


          <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
          <li class="!'slds-path__item ' + (equals(opportunity.path, 'Proposition/Nego') ? 'slds-is-active' : 'slds-is-incomplete')" role="presentation">
          <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
          <p> !opportunity.stage</p>
          </a>
          </li>
          </aura:iteration>


          JS Controller logic



          doInit: function(component, event, helper) 
          var dto = "opportunityId": '0064E000007QBNg' ;
          var action = component.get("c.searchOpportunity");
          action.setParams(
          "opportunityDto": JSON.stringify(dto)
          );
          action.setCallback(this, function (response)
          if (state === "SUCCESS")
          try
          var result = JSON.parse(response.getReturnValue());
          alert(response.getReturnValue());
          component.set('v.opportunityStages', result.opportunityStage);
          component.set('v.opportunityPath', result.opportunityPath);

          /* create list of opportunity stages and paths */
          var opportunityStateNPath = ;
          result.opportunityStage.forEach(function (stage, index)
          opportunityStateNPath.push();
          )
          component.set('v.opportunityStateNPath', opportunityStateNPath);

          catch (e)
          helper.handleJSException(component, response);

          else
          helper.handleAuraException(component, response);

          );
          $A.enqueueAction(action);






          share|improve this answer




















          • Its not working for me
            – Aruna
            Aug 23 at 5:38










          • Are you getting any errors?
            – itzmukeshy7
            Aug 23 at 5:39










          • the page is loading without the iteration part.
            – Aruna
            Aug 23 at 5:40










          • Can you share the updated code, what you are trying now?
            – itzmukeshy7
            Aug 23 at 5:41










          • I have added my updated code below as answer, Plz check that
            – Aruna
            Aug 23 at 5:47















          up vote
          1
          down vote













          Actually, we can do that, here you can take help of Map like:



          Component code



          <aura:attribute name="opportunityStages" type="List" />
          <aura:attribute name="opportunityPath" type="List" />
          <aura:handler name="init" value="!this" action="!c.doInit" />
          <aura:attribute name = "opportunityStagePath" type="Object" default="" />
          <aura:attribute name = "opportunityStageNPath" type="List" default="" />


          <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
          <li class="!'slds-path__item ' + (equals(opportunity.path, 'Proposition/Nego') ? 'slds-is-active' : 'slds-is-incomplete')" role="presentation">
          <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
          <p> !opportunity.stage</p>
          </a>
          </li>
          </aura:iteration>


          JS Controller logic



          doInit: function(component, event, helper) 
          var dto = "opportunityId": '0064E000007QBNg' ;
          var action = component.get("c.searchOpportunity");
          action.setParams(
          "opportunityDto": JSON.stringify(dto)
          );
          action.setCallback(this, function (response)
          if (state === "SUCCESS")
          try
          var result = JSON.parse(response.getReturnValue());
          alert(response.getReturnValue());
          component.set('v.opportunityStages', result.opportunityStage);
          component.set('v.opportunityPath', result.opportunityPath);

          /* create list of opportunity stages and paths */
          var opportunityStateNPath = ;
          result.opportunityStage.forEach(function (stage, index)
          opportunityStateNPath.push();
          )
          component.set('v.opportunityStateNPath', opportunityStateNPath);

          catch (e)
          helper.handleJSException(component, response);

          else
          helper.handleAuraException(component, response);

          );
          $A.enqueueAction(action);






          share|improve this answer




















          • Its not working for me
            – Aruna
            Aug 23 at 5:38










          • Are you getting any errors?
            – itzmukeshy7
            Aug 23 at 5:39










          • the page is loading without the iteration part.
            – Aruna
            Aug 23 at 5:40










          • Can you share the updated code, what you are trying now?
            – itzmukeshy7
            Aug 23 at 5:41










          • I have added my updated code below as answer, Plz check that
            – Aruna
            Aug 23 at 5:47













          up vote
          1
          down vote










          up vote
          1
          down vote









          Actually, we can do that, here you can take help of Map like:



          Component code



          <aura:attribute name="opportunityStages" type="List" />
          <aura:attribute name="opportunityPath" type="List" />
          <aura:handler name="init" value="!this" action="!c.doInit" />
          <aura:attribute name = "opportunityStagePath" type="Object" default="" />
          <aura:attribute name = "opportunityStageNPath" type="List" default="" />


          <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
          <li class="!'slds-path__item ' + (equals(opportunity.path, 'Proposition/Nego') ? 'slds-is-active' : 'slds-is-incomplete')" role="presentation">
          <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
          <p> !opportunity.stage</p>
          </a>
          </li>
          </aura:iteration>


          JS Controller logic



          doInit: function(component, event, helper) 
          var dto = "opportunityId": '0064E000007QBNg' ;
          var action = component.get("c.searchOpportunity");
          action.setParams(
          "opportunityDto": JSON.stringify(dto)
          );
          action.setCallback(this, function (response)
          if (state === "SUCCESS")
          try
          var result = JSON.parse(response.getReturnValue());
          alert(response.getReturnValue());
          component.set('v.opportunityStages', result.opportunityStage);
          component.set('v.opportunityPath', result.opportunityPath);

          /* create list of opportunity stages and paths */
          var opportunityStateNPath = ;
          result.opportunityStage.forEach(function (stage, index)
          opportunityStateNPath.push();
          )
          component.set('v.opportunityStateNPath', opportunityStateNPath);

          catch (e)
          helper.handleJSException(component, response);

          else
          helper.handleAuraException(component, response);

          );
          $A.enqueueAction(action);






          share|improve this answer












          Actually, we can do that, here you can take help of Map like:



          Component code



          <aura:attribute name="opportunityStages" type="List" />
          <aura:attribute name="opportunityPath" type="List" />
          <aura:handler name="init" value="!this" action="!c.doInit" />
          <aura:attribute name = "opportunityStagePath" type="Object" default="" />
          <aura:attribute name = "opportunityStageNPath" type="List" default="" />


          <aura:iteration items="!v.opportunityStageNPath" var="opportunity">
          <li class="!'slds-path__item ' + (equals(opportunity.path, 'Proposition/Nego') ? 'slds-is-active' : 'slds-is-incomplete')" role="presentation">
          <a aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-1" role="option" tabindex="0">
          <p> !opportunity.stage</p>
          </a>
          </li>
          </aura:iteration>


          JS Controller logic



          doInit: function(component, event, helper) 
          var dto = "opportunityId": '0064E000007QBNg' ;
          var action = component.get("c.searchOpportunity");
          action.setParams(
          "opportunityDto": JSON.stringify(dto)
          );
          action.setCallback(this, function (response)
          if (state === "SUCCESS")
          try
          var result = JSON.parse(response.getReturnValue());
          alert(response.getReturnValue());
          component.set('v.opportunityStages', result.opportunityStage);
          component.set('v.opportunityPath', result.opportunityPath);

          /* create list of opportunity stages and paths */
          var opportunityStateNPath = ;
          result.opportunityStage.forEach(function (stage, index)
          opportunityStateNPath.push();
          )
          component.set('v.opportunityStateNPath', opportunityStateNPath);

          catch (e)
          helper.handleJSException(component, response);

          else
          helper.handleAuraException(component, response);

          );
          $A.enqueueAction(action);







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 23 at 5:30









          itzmukeshy7

          2,235922




          2,235922











          • Its not working for me
            – Aruna
            Aug 23 at 5:38










          • Are you getting any errors?
            – itzmukeshy7
            Aug 23 at 5:39










          • the page is loading without the iteration part.
            – Aruna
            Aug 23 at 5:40










          • Can you share the updated code, what you are trying now?
            – itzmukeshy7
            Aug 23 at 5:41










          • I have added my updated code below as answer, Plz check that
            – Aruna
            Aug 23 at 5:47

















          • Its not working for me
            – Aruna
            Aug 23 at 5:38










          • Are you getting any errors?
            – itzmukeshy7
            Aug 23 at 5:39










          • the page is loading without the iteration part.
            – Aruna
            Aug 23 at 5:40










          • Can you share the updated code, what you are trying now?
            – itzmukeshy7
            Aug 23 at 5:41










          • I have added my updated code below as answer, Plz check that
            – Aruna
            Aug 23 at 5:47
















          Its not working for me
          – Aruna
          Aug 23 at 5:38




          Its not working for me
          – Aruna
          Aug 23 at 5:38












          Are you getting any errors?
          – itzmukeshy7
          Aug 23 at 5:39




          Are you getting any errors?
          – itzmukeshy7
          Aug 23 at 5:39












          the page is loading without the iteration part.
          – Aruna
          Aug 23 at 5:40




          the page is loading without the iteration part.
          – Aruna
          Aug 23 at 5:40












          Can you share the updated code, what you are trying now?
          – itzmukeshy7
          Aug 23 at 5:41




          Can you share the updated code, what you are trying now?
          – itzmukeshy7
          Aug 23 at 5:41












          I have added my updated code below as answer, Plz check that
          – Aruna
          Aug 23 at 5:47





          I have added my updated code below as answer, Plz check that
          – Aruna
          Aug 23 at 5:47


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f229856%2fneed-to-iterate-2values-inside-single-auraiteration%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

          Crossroads (UK TV series)

          ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế