Runtime error when no record found in SQL database?

Hi, I would like to ask if no record found show message instead of show end application error message ?
I had tried use debug Do it to find out where problem, but unsuccessful.

error


Anyone help is much appreciate.

You are trying to make a list here:


so you need to test for list data being returned in responseContent before this.

your blocks look very cumbersome... also there is a lot of redundancy...
first you get all columns, then you divide that into 3 different columns, and finally you use several replace all blocks to display the result in separate labels...

what about displaying the result in a table? you can find several solutions after doing a search in the community, see also Tableview Extension V3 by @Ken

why do you need all these replace all blocks? can't the data be provided in a better format?
my MySQL example https://puravidaapps.com/mysql.php provides the data in a csv table directly

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Hi TIMAI2,
I'm still new learning MIT app inventor.
I know the problem is here, but i no idea how to put a block handle if no record here.
can you show me in detail ?

Hi all, problem resolved.
thanks.

Might be good if you told us how your fixed it, this may help others with the same issue....

Hi, sure
need use if then else condition.

7c785f27833829148b27b2b7ba4abe3b8e74f6ca_2_454x500

Are you sure AI2 will let you do a list add against a non-list text value?
Or is there some other place in your blocks where globals column1-3 are being properly reset to empty lists?

Capture

Hi ABG, yes I reset back the global column 1-3 to empty lists
Please refer back my first post#1.

So you got lucky, and left the incorrect blocks in the checking procedure.

It is better to be right than to be lucky.

Mediocretes

Hi ABG,
ya you are right.
so do you have any idea to be do it in correct way ?

Go back and read all your blocks.

Everywhere you set global column1 to blank text instead set it to create empty list.
Do the same for column2 and column3.

Well noted.
Thanks.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.