If condition not satisfied

hi i made an app similar to this : https://gallery.appinventor.mit.edu/?galleryid=5252195650240512
i want to test my app but it is not working and i loaded this project ( https://gallery.appinventor.mit.edu/?galleryid=5252195650240512) into my appinventor but it is also not working can you tell me where the error is i found the error at 2 sections in my app and as similar in this project in a do- result block ( parsecountryresult and parseglobalresult) the if condition is not satisfied i dont know why pls help me
thanks in advance

Please read this

fs1|669x373 fs
the problem is in these both procedure blocks the if condition is not satisfied i dont know why

i intialized tempdata and tempdata2 variable as a blamk text string

Why are you over writing this variable?

im not overwriting everytime the condition satisfies it will get the item and set as tempdata and will then get the data and select item and once its done it will encode that value of the variable and it will decode and finally i will get the value of tempdata
can u also tell why if condition is not satisfied?

It would make debugging easier if you were to devote separate global variables to each step of your computation, to leave a trail you could examine afterwards using the Do It facility.

Hello Kaushik,
there are no other reasons: the lenght of list of tempData is not = 2 .
Try to display the value of the "lenght of list list tempData". You can use the procedure suggested by ABG :ok_hand: or just assign the value to a label, and display it. For sure it will not be = 2, therefore verifying which value it has, you can find what behaves differently from what you expect .

i tested it it is showing the length of the list is 1 but when i give one its giving an error because im asking 2 index inside the if condition

i cant debug it i will share the aia can you pls do it for me?
CoronavirusHelpApp_2.aia (1.4 MB)

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

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

Hello Kaushik,
now that you've seen that the number of elements of the list is only 1, you can understand why the if statement does not enter. More, it seems that the list contains empty fields. I guess now it is time to follow the hints that ABG and Taifun have already suggested and use the Do it.
All the best.

i used do it function it is giving the value when its else condition for example i set the variable to" a" when the if condition is satisfied and when it is not satisfied ( else ) i will set it to "b" when i give do it it is showing the else value only :frowning:
and also when i give if the length of the list is = 1 it is showing this error

can you tell me the error in my program

You used the green = block from the logical group to compare the condition. You must use the blue = block from the math group.

You can use either....

I'm being having a look to your app. Though I'm not an expert, I see that you open 20 (more or less) screens when the suggested limit is no more than 10. Please take a look to this thread:

I guess it's not related to you issue, but be careful, anyway.

I've tried to see the websites you set in your global variables
but if I put these links in my browser (Chrome), the relevant pages remain blank. I'm from Italy, so I'm not sure if there are some limitations from my country, but are you sure that you can get those pages ? Since it seems that you get back empty strings, which generate the error:

Please check.

i too tried the website its blank since its api i have done when the person selects the country the country code will be added to the website which will be working website
and when i made this app it worked ( 5 months ago ) but now it is not working as i didnt change anything
and also i got the blank site
i got help from this project my project is similar to this :point_down:

I've downloaded the original aia from gallery, loaded and run onto a phone: all responses are "No response from Google" for any country that I select.
Also the global stats are also unavailable: the stats does not need to add the country, it should work directly, but it doesn't work.
I browsed the web to find if others have had the same problem, and it seems that also other people cannot access the data by using these API's.
At this point maybe other friends in the community will have better ideas.

1 Like