Questions tagged [aura-iteration]

questions regarding the aura:iteration component. This coomponent iterates over a collection of items and renders the body of the tag for each item.

Filter by
Sorted by
Tagged with
12 votes
4 answers
5k views

How do we identify which lightning input is updated in an iteration?

I'm trying to construct a page that allows users to edit records, and it should be in SLDS, so I'm trying to use lightning:input to minimize the amount of code I need to write. Ultimately, a method ...
sfdcfox's user avatar
  • 468k
12 votes
2 answers
1k views

Is it possible to use the new v41.0 lightning:outputField in huge numbers inside tables? Is it possible to extend it?

Today I'm giving the new v41.0 <lightning:outputField> a try. I want to use it massively inside an <aura:iteration> to build a data-table and want to accomplish the following: ...
Uwe Heim's user avatar
  • 34.1k
7 votes
1 answer
34k views

How to check List size in aura:iteration

I am showing list of opportunity in a Lightning component. And I want to display them if the opportunity list size > 0 . i.e here ( opportunityList > 0) <lightning:select name="...
Arijit Chowdhury's user avatar
7 votes
3 answers
19k views

component.find an aura:id item created in aura:iteration

I am building a menu component. One menu-item is a sub-menu with list of opportunities, this list is created with aura:iteration over a list of opportunities. When selecting a menu or a sub-menu, I ...
Itai Shmida's user avatar
  • 4,935
5 votes
1 answer
401 views

Is it prudent to use force:recordData (and similar) within aura:iteration?

The aura framework and lightning:recordData currently (Summer 18) support only single object retrieval. Let's assume I got a listItem.cmp into which I wired force:recordData in VIEW mode or a ...
Christian Szandor Knapp's user avatar
5 votes
2 answers
1k views

Why aura:iteration doesn't re-render when you add element to parent component's list?

I declared a parentComponent with an attribute of type list. I am passing that list to child component. In my child component, I am iterating over that list using aura:iteration . Also I provided a ...
Pranay Jaiswal's user avatar
4 votes
2 answers
690 views

Lightning aura:iteration issue with deleting element after sorting

Recently I got a very weird issue with aura:iteration and don't know how to solve it yet. If I sort my list of element to ascending order and delete some element from the list then if I try to sort ...
steals's user avatar
  • 1,243
4 votes
1 answer
2k views

Updating aura attribute in 1 aura:iteration does not reflect the changes in another aura:iteration

I've created a simple lightning app which has an aura:attribute of type Object[] with 3 objects in it. I'm binding their selected property to a lightning:input of type checkbox. When I update the ...
Chirag Bhatia - chirag64's user avatar
3 votes
1 answer
4k views

Iterating Complex Map in Lightning

I'm working a lightning component, which has a requirement of displaying a dynamic table. For that, I need to iterate over a map (Map>) and display the values. So, How can I retrieve map from apex ...
ChamingaD's user avatar
  • 313
3 votes
2 answers
4k views

How do I get the value of a row of HTML table in an aura iteration with onclick?

I am trying to make a functionality where my lightning component shows a table of records and I want to make it so if you click a records row, it autofills my form with that records information. Here ...
Alexander Atkinsoon's user avatar
3 votes
0 answers
842 views

Lightning "change" event doesn't fire in aura:Iteration

I am passing an Object to my component and iterate through it's child records. To handle changes I added the Lightning change handler. (I made data an array, so I can set a default for demo purposes, ...
itsmebasti's user avatar
  • 6,280
2 votes
2 answers
7k views

aura:iterate in two columns

How would one create a two list column and be populated with an iterated list. Right now, both columns just repeat themselves with the same {!v.Name} data. I would like to remove the repetition and ...
Jeff's user avatar
  • 191
2 votes
1 answer
9k views

Lightning Components: How to do nested aura:iteration of a list of Accounts with subselected Contacts?

Scenario In Visualforce we had strong patterns for implementing the rendering of hierarchical structures. As a simplified example (standing for many other use cases) let's say we want to show all ...
Uwe Heim's user avatar
  • 34.1k
2 votes
1 answer
747 views

Iterate related records, display images from string name of contentAsset in Community Cloud

I'm very new to Salesforce, so my apologies if my approach is all wrong. I want to display a list of buttons with images using a lightening component in Community Cloud. The list comes from records ...
ryguy's user avatar
  • 33
2 votes
2 answers
2k views

Nested wrapper class to use with Aura:iteration in lightning component

How to use aura:iteration over a list of Wrapper class object in Lightning component 1st Aura iteration works well it prints axisNo and axisName correct. But nested iterate with nested wrapper class ...
Priya's user avatar
  • 115
2 votes
1 answer
1k views

Lightning radio selector in iteration disappears when option selected in another row

I have created a Lightning component that allows users to dynamically create their desired number of records. I implemented a data table for this. In my third column, I asked users to select from two ...
womanwhodevs's user avatar
2 votes
1 answer
5k views

LWC create input fields under LWC iteration

I am new to LWC. I have to create multiple input fields for different rows. Let say, I have selected 3 records from the previous page and for all those 3 records I need to create the input field and ...
SFDC 44's user avatar
  • 664
2 votes
1 answer
2k views

How to conditionally render rows in iteration lightning component

I have a lightning iteration component that shows several information on accounts in a row. One of the columns allows the user to choose a lookup( I use a custom lookup component) value to edit the ...
Marcos Martinez's user avatar
2 votes
0 answers
164 views

Route User to Newly Created Record from Flow

so using the Override Finish Behavior feature https://help.salesforce.com/s/articleView?id=sf.flow_concepts_finish_override.htm&type=5 I am having issues routing the user to the newly created ...
andrew's user avatar
  • 141
2 votes
1 answer
1k views

<force:recordData> not getting called

I'm facing trouble with <force:recordData>. I have a list of custom objects displayed in the form of table over <Aura:iteration> Out of that list, when a button is clicked, a certain ...
AjaySFDC's user avatar
  • 605
1 vote
2 answers
929 views

3 nested aura:iteration's don't work properly

I have the following object in Javascript: [{"Name" : myName, "Sub" : [{"Name": mySubname, "Items" : [{"Id": a, "Name": b},{"Id": c, "Name": d}, ...] }, {...}, ....
user3529582's user avatar
1 vote
2 answers
1k views

how to filter the collection used in aura:iteration

I would like to have a filtered version of a collection as the source data of an aura iteration. Basically, something like this: <aura:iteration items="{! v.myList.filter(element => ....) }" ...
user73893's user avatar
  • 305
1 vote
1 answer
530 views

<aura:if not working but <aura:renderif does - any reason why that you guys can see?

so the scenario is that i have an iteration within an iteration .... <aura:handler name="init" value="{!this}" action="{!c.setUpScreen}" /> <aura:attribute name="PageQuestions" type=...
Phil Macleod's user avatar
1 vote
1 answer
15k views

Using an aura:iteration index as an array accessor [duplicate]

I am creating a lightning component that is a Day-of-the-Week picker widget. it will allow a user to enable or disable days from a list. My front has two attributes that are useful here - a list of ...
captain_jim1's user avatar
1 vote
1 answer
19k views

aura if comparing iteration variable

I would like to know if it is possible to evaluate the expresion not comparing to a constant but instead to another variable, like the iteration variable from aura:iteration. I want to evaluate the ...
ElkCor's user avatar
  • 197
1 vote
2 answers
4k views

Aura Iterate, get the aura:id of a span

I'm trying to get the ID of an element that is in a loop to trigger an event, but I can't get the ID nor content of the tag. I've done something similar on visual force pages, but I did it ...
ekiim's user avatar
  • 313
1 vote
2 answers
3k views

Retrieve elements created with Aura:Iteration

I'm trying to retrieve elements using document.getElementsByClassName("") within the afterRender function. This works as expected with normal elements. However, I can't seem to retrieve elements being ...
Aubrey Walts's user avatar
1 vote
1 answer
2k views

Radio Button within Iteration - When user selects radiobutton, store the associated sourceId in attribute 'accountId'

Currently, I'm iterating through a wrapper that includes sourceId (aka accountId) and Opportunity Name, etc. When the user selects a radio button, I want to capture that sourceId in an attribute at ...
Ryan McNeely's user avatar
1 vote
1 answer
261 views

Trouble with aura:if

I am not sure why this is not working. I have an aura:if condition, if the check matches then the item should be displayed. Here in this code below I am checking the ofc.agentName is not empty then ...
sumchans's user avatar
  • 603
1 vote
1 answer
377 views

Get Task description with line breaks in SOQL

I have a lightning component that displays a List of Tasks in a sidebar. I use a SOQL query in the controller to fetch a List that fits the criteria and display them in the component. I manually model ...
to_the_nth's user avatar
1 vote
2 answers
3k views

How to find id of lightning component tag which defined in iteration?

<aura:iteration items="{!v.List}" var="item" indexVar="i"> <div id="{!v.globalId + '_option'}" data-index="{!i}" data-id="{!item.Id}" onclick="{!c.jsFunction}"><text-...
Mohit Kumar's user avatar
1 vote
1 answer
4k views

Display fields if null in an aura:iteration

I'm making an edit records component on Opportunity where I display fields from related objects like Account, the Primary Contact and Contact Role only if their value are null. For the Account and the ...
Gwaldhorf Miopau's user avatar
1 vote
1 answer
1k views

Passing an aura:iterated list item to JS controller

The goal is to pass a "comment__c" rich text field on an iterated object to its JS controller to perform a string operation on it before it's returned to limit a tooltip it is to appear into 250 ...
Jeff's user avatar
  • 191
1 vote
1 answer
107 views

How to dynamically select and disable an element in a row in the table when the other element is selected

I am new to Aura and hence was not able to find out the exact way to disable the column. We are building a table where I need to disable other cells in the row when one of the cell is selected. The ...
King Dev's user avatar
  • 444
1 vote
1 answer
1k views

Get Row Id for a Lightning:ButtonIcon

I am adding a buttonIcon for each aura:iteration record in my interface. I need to get the Id of the row that the button is on. Here is my component code: <aura:iteration items="{!v....
JP Blonshine's user avatar
1 vote
1 answer
776 views

Second <aura:iteration> not working with object/array datasource

I have a Lightning component with two <aura:iteration> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <aura:attribute name="invoices" type="Object" /> <aura:...
Robs's user avatar
  • 8,897
1 vote
1 answer
727 views

How to fetch the accounts based on a value checkbox

I have a dynamic checkbox generator which is bound by city on the account which works fine all cities are rendered with a corresponding checkbox. When I select the checkbox a city is added to a list ...
Thomas's user avatar
  • 2,284
1 vote
1 answer
12k views

How to use lightning:outputField and lightning:inputField inside an aura:iteration

How can I use the new v41.0 <lightning:outputField> inside an <aura:iteration>? I have tried this <aura:attribute name="Opportunities" type="Object" default="{}" /> <aura:...
Uwe Heim's user avatar
  • 34.1k
1 vote
1 answer
819 views

Component.find returns elements not on page

I have an array of sections, which are objects that each contain an array of fields. If I reset this array and then look for the fields using component.find(), it returns many more fields than display ...
KDar's user avatar
  • 15
1 vote
1 answer
36 views

aura:interation Field Order

I'm developing a component to add multiple items (in this example debts). When a new debt is added I need the fields to display like so: At the moment the fields display like this: Here is my ...
user78806's user avatar
1 vote
1 answer
693 views

Display table with data from two sources - array and map - Aura Components

I have related objects with a one-to-many relationship. For example: Owner1 ---> Thing1 Owner1 ---> thing2 Owner2 ---> Thing3 I want to display data from these objects in a table ...
eaeaoo's user avatar
  • 908
1 vote
1 answer
4k views

Aura Components Specialist: Step 3: Completed but tiles do not display data?

I've just completed step 3 of the Aura Components Specialist superbadge however the tiles for the boat search results just display an empty block on the page. Not sure why this is happening. I've ...
Kevin's user avatar
  • 295
1 vote
2 answers
753 views

Display radio group dynamically

I'M trying to display radio groups inside aura iteration,the number relays on the number of elements of the Questions list,but not only selected options are not being checked ,it also happens that ...
Dead_end_Developer's user avatar
1 vote
1 answer
323 views

Aura iteration for Kanban

I'm trying to create Kanban. My lists have many cards, but I can see only one card per list. I added ORDER BY ListId__c to SOQL but I still can't see other cards. First 2 lists have a few cards. How ...
MichaelLev19's user avatar
1 vote
2 answers
2k views

Is it possible to "find" an aura:id within an aura:id?

I have a component where I am building a lightning:recordEditForm using fields based on a different field sets that looks a little something like this: <aura:component> <aura:attribute ...
griffinmelnick's user avatar
1 vote
1 answer
892 views

Aura iteration returning blank rows(with correct number of rows)

My requirement is to display all the saved values on load for a Custom object called Company__c. Fields being Full_Name__c (text), Address__c(text area) , Director_Name__c (text), Phone__c (phone) and ...
Mayank Parnami's user avatar
1 vote
2 answers
158 views

How do i iterate over a list with 3 different object types in lightning component?

I am building a lighting component which needs to iterate over a list with three different object types but I have run into a problem because I cannot write an aura if expression which checks the ...
user64485's user avatar
1 vote
1 answer
2k views

Aura:iteration with Data Tables and setting the order to descending as rows are inserted

So we have a client that has a form page where a Data Table is built based on input. As they enter items the table sorts them by index (i'm assuming) in ascending order. Without making the user sort ...
weytani's user avatar
  • 387
1 vote
1 answer
2k views

To compare old and new value inside aura:iteration in Lightning component

In Lightning I have a requirement where I will iterate a List and display it as a table.While iterating I need to compare old value(last iterated row value) and new value (value in current iteration) ...
Sindhuja's user avatar
  • 133
1 vote
1 answer
2k views

aura:iteration to display data in columns after certain count

<fieldset class="slds-form-element slds-m-top_xx-large form-fields-width borderForBoxes"> <LEGEND class="slds-form-element__label tlabel slds-text-body_small"> ...
user5495947's user avatar