I have response a JSON like this:

```
{
    "StatusCode": 0,
    "StatusMessage": "OK",
    "StatusDescription": [
        {
            "product_id": "1",
            "Name": "ALMACINE",
            "qty": 5,
            "price": 10
        },.....
        {
            "product_id": "10",
            "Name": "BUPRENORFIN",
            "qty": 5,
            "price": 10
        },
        {
            "product_id": "11",
            "Name": "MAMIGUMMY",
            "qty": 5,
            "price": 10
        },
        {
            "product_id": "12",
            "Name": "CEFALEXINE",
            "qty": 5,
            "price": 10
        },
        {
            "product_id": "13",
            "Name": "BUPRENORFIN",
            "qty": 5,
            "price": 10
        },
        {
            "product_id": "14",
            "Name": "MAMIGUMMY",
            "qty": 5,
            "price": 10
        }
    ]
}

```

I want to search for product with Name in this JSON with 2 steps.
First, I want to search only in this JSON. If doesn't exist any product I want to go call a function that response all product with here name.

My code:

```
  filteredMedic : Products[];

public SearchProducts(args) {
    let searchBar = <SearchBar>args.object;
    let searchValue = searchBar.text.toLowerCase();
    this.filteredMedic = searchValue.length ? this.products.filter(item => {
        return item['Name'].toLowerCase().includes(searchValue)
    }) : this.products;
    if(this.filteredMedic === []){
           this.productsservice.search_AllProduct(searchValue).subscribe(
            farmaciadata => {
                console.log('farmaciadata', farmaciadata)
          }
           );
    }
}

```

In this code, search in list works good, but when this.filteredMedic is empty step 2 doesn't work. How to search product in backend and display in view?
My HTML code:

```
<StackLayout *ngFor="let prod of filteredMedic; let i = index;">
............
</StackLayout>

```