I have one list method like below
@AuraEnabled
public static List<String> getDetails(String AccName){
listacNameList = new list(); List accList = new List([Select Id, Name from account where Name=:AccName]); for(account acc: accList ){ acNameList.add(acc.Name); } return acNameList ; }
in LWC i have input text where i need to show all Account but not duplicate
<lightning-card variant="narrow">
<label class="slds-form-element__label">Select Account</label>
<input data-id="inputFilter" onchange="" required value={accValues} name="input" list="filterList" placeholder="search account" />
<datalist data-id="filterList" id="filterList" class="">
<template for:each={accDetails} for:item='item'>
<option key={item} value={item}>{item}</option>
</template>
</datalist>
</div>
</lightning-card>
**JS**
accDetails = [];
getDetails({AccName: this.value})
.then(result=>{
if(result){
this.accDetails= result;
}
there are chances that i will get duplicate account Name in input filter which i dont want, i am not able to remove duplicate account Name from result. Please suggest