Hi! I'm doing an app. And I have a problem when I try to get the value of a FusionTable.
I want to select some values of a list. But if in the value there is no text, it gives an error.
I try doing:
if select list item = 0
then...
else,,,
But it always give an error.
I attach the screenshot of the code.
Thanks for your help.
--
It gives me the same error :
--
the fusiontable control got result event will only fire after sending a query to the table...
after sending it once, then there should be a value available in variable LISTA and then you also can use Do it for debugging...
Taifun
--
Yes, but the matter is that the fusiontable don't return a value because there's no enough values of Index.
--
Index 1 works because there's one value, but the second doesn't work because there is no a value in the fusiontable.
So what I want to do is if the fusiontable don't return a value set a message like: Error.
But I can't set
if the list is empty
then set Label... to Error
Else set Label to Select Item (list/index)
the fusiontable don't return a value because there's no enough values of Index.
???
the fusiontable always will return something
a) a result as csv table
b) an error message
how does the query look like?
It would really help if you provided a screenshot of your relevant blocks incl. Do it result of the SQL query, so we can see what you are trying to do, and where the problem may be.
see also
Taifun
--
It returns an error: Select list item: Attempt to get item number 9 of a list of length 7: .
Is the result of the fusiontable without doing a select item.
I provided the screenshots:
The Screenshot :
to select the 9th item of a list, which only has 7 items does not make much sense, does it?
from the fusiontable control got result event in your case you receive a 1 column csv table (because you selected only 1 column)
to simplify a little bit, convert that table into a list use the split block, just split at \n (new line), (see arrow screenshot 1)
and remove the first item (which is the header row)
then before selecting the 9th item of a list make sure, that this is a list, which has min. 9 items (see arrow screenshot 2)...
if length of list (LISTA) < 9
then error
else display the 9th item
also it seems to be, you are not familiar with Do it?
see tip 4 here
Top 5 Tips: How to learn App Inventor
and again
Taifun
--
That works!! Thank you !!
--
댓글 없음:
댓글 쓰기