+ Start a Discussion
chandrashekar Jangitichandrashekar Jangiti 

Hi folks..I need one solution for below code in LWC in Javascript

I need one solution for below code in LWC in Javascript..actually i need to show 'No results found' while searching in search box ,if no results found shows in below search box it should not selectable..

if (storeResponse.length == 0) {
                    component.set("v.Message", 'No Result Found...');
                } else {
                    component.set("v.Message", '');
                }
ANUTEJANUTEJ (Salesforce Developers) 
Hi Chandrashekar,

I found the below implementation similar to your usecase can you please have a look at it and in this example they are searching for values and in case if they are not finding any they are showing an error message.

>> https://sfdcmonkey.com/2019/08/16/record-search-functionality-salesforce-lwc/

I hope this helps and in case if you use this follow all the best practices for your implementation so that it can be future proof for your implementation.

In case if you found it useful can you please choose this as the best answer.

Regards,
Anutej