If JSON array not found, how to display error

i have the JSON API

if the JSON has a data will respond

if the JSON has a nodata will respond

how can I display no data ?

It would be something like this but I can’t test it because what you posted is not valid JSON:

That will probably work for you. But if your JSON ever gets more complicated than that, you may get a false positive (true) because that’s going to search the entire JSON response for your search key (“demo1”) and if it finds it anywhere, it will return true.