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
bheemudu neelibheemudu neeli 

I need a help on auto search functionality sample code

Hello All,
I need a help on auto search functionality sample code  as input value, so that i can use that field value to assign to other field.

Thank you,
SwethaSwetha (Salesforce Developers) 
HI Bheem,
Recommend reviewing the below links to get started:

If this information helps, please mark the answer as best. Thank you
Hii Bheemudu
Try Below Code
            <lightning-input type="search" onchange={handleChange} class="slds-m-around_medium" label="Search">  
        <table class="slds-table slds-table_cell-buffer slds-table_bordered">
                <tr class="slds-line-height_reset">
                  <th class="" scope="col">
                    <div class="slds-truncate" title="Account Name">Account Name</div>
                  <th class="" scope="col">
                    <div class="slds-truncate" title="Parent Account">Parent Account</div>
                  <th class="" scope="col">
                    <div class="slds-truncate" title="Type">Industry</div>
                  <th class="" scope="col">
                    <div class="slds-truncate" title="Rating">Rating</div>
                  <th class="" scope="col">
                    <div class="slds-truncate" title="Phone">Phone</div>
                  <th class="" scope="col">
                    <div class="slds-truncate" title="Ownership">Ownership</div>
                <template for:each={records} for:item ='record'>
                <tr class="" key = {record.Id}>
                        <td data-label="Account Name">
                            <div class="slds-cell-wrap"><a href="javascript:void(0);">{record.Name}</a></div>
                        <td data-label="Parent Account">
                            <div class="slds-cell-wrap"><a href="javascript:void(0);">{record.ParentId}</a></div>
                        <td data-label="Industry">
                            <div class="slds-cell-wrap">{record.Industry}</div>
                        <td data-label="Rating">
                            <div class="slds-cell-wrap">{record.Rating}</div>
                        <td data-label="Phone">
                            <div class="slds-cell-wrap">{record.Phone}</div>

import { LightningElement,api,track,wire } from 'lwc';
import getAllAccounts from '@salesforce/apex/TestTable.getAllAccounts';
export default class testTable extends LightningElement {
    @api records;
    @api errors;
    @track Name;

        var sVal =;
        this.Name = sVal;

        Name :  "$Name"}
        this.records = data;
        this.errors = undefined;
        this.errors = error;
        this.records = undefined;

public class customTable {
 @AuraEnabled(cacheable = true)
    public static List<Account> getAllAccounts(String Name){
        system.debug('Name===> ' + Name);
        String key = '%' + Name + '%';
        List<Account> accList =[Select Id,Name,Ownership,
                                Industry,Rating,ParentId,Phone FROM Account WHERE Name LIKE : key];
        return accList;
Please Mark It As Best Answer If It Helps
Thank You!