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
bretondevbretondev 

Trying to get the id of the records that was clicked in aura:iteration

Hello

I am trying to get the record id of the reocrd that was clicked in an aura:iteration.
But instead of getting the value of the id , I get the EL , I don't undrstand why.
 
<aura:iteration items="{!v.doublons}" var="item">
                <lightning:card title="{!item.nomCompteRaisonSociale}" class="slds-m-around_x-small">
                    <aura:set attribute="actions">
                        <ui:button press="{!c.onClickSeeAccount}" aura:id="{!item.recordId}" label="Voir le compte" class="slds-m-around_x-small" />
                    </aura:set>
                    <p class="slds-p-horizontal_small">
                        Siret : {!item.siret} <br/>
                        Rue : {!item.shippingStreet} <br/>
						Code Postal : {!item.codePostal} <br/>
                        Ville : {!item.ville} <br/>
                    </p>
                </lightning:card>
            </aura:iteration>
 
({
	onClickSeeAccount : function(component, event, helper) {
		var searchResults = event.getSource().getLocalId();

	}
})

User-added image
Best Answer chosen by bretondev
bretondevbretondev
I have found a way to do this with solution provided by Chuck in this post :
https://developer.salesforce.com/forums/?id=906F0000000kAn0IAE