how to remove the column(header) when out of the text in (get result)

281 views
Skip to first unread message

MrLam

unread,
May 31, 2016, 12:27:09 AM5/31/16
to MIT App Inventor Forum
Hi All,

I have succeeded to retrieve the data from the fusion table but how can i remove the heading of the column (in this case "YuenLong"), out of the text when "get result"? I tired 2 method but failed.

i just want to show the number only....
Thanks a lot for your great help...

Lam
Method 1.PNG
method2.PNG
fusiontable data.PNG

MrLam

unread,
May 31, 2016, 12:33:07 AM5/31/16
to MIT App Inventor Forum
Hi,

For your information ; Column = YuenLong and Row = 150 in fusion table.
now i just want to show the row only when "get result" in text box,,,


thanks again

Taifun

unread,
May 31, 2016, 8:41:16 AM5/31/16
to MIT App Inventor Forum
in the fusiontable control got result event convert the result into a list using the split block, just split at \n (new line)
then select the second item from the list using the select list item block, which is the requested data


Taifun

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

MrLam

unread,
May 31, 2016, 9:29:29 AM5/31/16
to MIT App Inventor Forum
Hi Taifun,

i have updated the block as attached.
set global List to create empty list and then using split block to split it at \n
select the second item but failed again...

can you pls point out which procedure i do it wrong?
thanks

error.PNG
message.PNG

Taifun

unread,
May 31, 2016, 9:54:30 AM5/31/16
to MIT App Inventor Forum
your blocks look fine
use Do it to debug your blocks, see also tip 4 here
and use Do it after having received the result...
Taifun

MrLam

unread,
May 31, 2016, 10:15:19 AM5/31/16
to MIT App Inventor Forum
Hi Taifun,

i assumed it is correct too but i'm not sure why the error message comes out again.,

*******Error from Companion: Select list item: Attempt to get item number 2 of a list of length 1: (accounts.google.com
******Error from Companion: Select list item: Attempt to get item number 2 of a list of length 0: ()

Sorry - i really don't understand what's wrong....
can you pls guide again
error.PNG

Abraham Getzler

unread,
May 31, 2016, 10:32:08 AM5/31/16
to MIT App Inventor Forum
You probably have some kind of error message from Fusion Tables in your result, way upstream of where you apply Do It.

It's unfortunate that you do not display the result.


Taifun

unread,
May 31, 2016, 10:46:19 AM5/31/16
to MIT App Inventor Forum


MrLam

unread,
May 31, 2016, 10:57:23 AM5/31/16
to MIT App Inventor Forum
Hi Taifun,

yes indeed i have "Do It" , see attached.
so which Block/part i should amend it?
error.PNG

Abraham Getzler

unread,
May 31, 2016, 11:06:38 AM5/31/16
to MIT App Inventor Forum
See attached for where to Do It upstream.

DoIt.png

Taifun

unread,
May 31, 2016, 11:53:21 AM5/31/16
to mitappinv...@googlegroups.com
to use Do it only makes sense after having received the result...
else obviously the result is empty
Taifun

MrLam

unread,
May 31, 2016, 11:55:50 AM5/31/16
to MIT App Inventor Forum
Hi, Abraham Getzler

Thanks for your inf.
However i am a bit blur on it because actually i don't know where the Block for "call (log) text"and "call (csvRows) table" to select :(
it is much appreciated if your can advise more details to me...  sorry sir!

It is midnight here and i will try again on tomorrow.
anyway , thanks for your help!



MrLam

unread,
May 31, 2016, 12:04:45 PM5/31/16
to MIT App Inventor Forum
Hi Taifun,

Yes sure... so that's why i am in blur..
The result was show as: ( YuenLong 150 )

In the fusion table i set YuenLong as Column and 150 as Row.

i dont know which step/Block is wrong and i want to show Row only in the text box.
i have split the result by using split block and select list item in index 2........

error.PNG

Taifun

unread,
May 31, 2016, 12:19:00 PM5/31/16
to MIT App Inventor Forum
The result was show as: ( YuenLong 150 )
where was that result shown?
what about showing us the Do it results then after having received the result?
Taifun

Abraham Getzler

unread,
May 31, 2016, 1:10:27 PM5/31/16
to MIT App Inventor Forum
My example was from this app in the Gallery
explained in detail in this doc ...

The Log procedure is accessible thru the doc's Table of Contents,
and is handy for collecting and displaying diagnostic information.

MrLam

unread,
May 31, 2016, 11:08:23 PM5/31/16
to MIT App Inventor Forum
Good day Taifun,

(with heading case that is no problem to get the data from fusion table)
For attached Pic1 - It is the original one which result show as "
package $result" and "YuenLong 150" in emulator.

For attached error1 - i have changed the block as mentioned last night and got the error message when click "Do it"
in the block of "select list item list".

**error message:
Error from Companion: Select list item: Attempt to get item number 2 of a list of length 0: ()
Do you know what is the problem?

When i click "DO it" in Split block test - get result - it shows "$result"
When i click "DO it: in Split block at  - get result - it shows "-"

so i supposed the "Split block" entry is correct and the problem is the second block of "select list item list", can you
guide me how to correct it?

Pls let me know if i understand it wrongly.
thanks

 
pic1.PNG
error(1).PNG

MrLam

unread,
May 31, 2016, 11:23:34 PM5/31/16
to MIT App Inventor Forum
Hi, Abraham Getzler,

Headache.....
i have studied your example and trying to update the block as attached..
oopssss not work again...
new1.PNG
new2.PNG
new3.PNG

MrLam

unread,
Jun 1, 2016, 2:40:40 AM6/1/16
to MIT App Inventor Forum
Hi Taifun / Abraham Getzler,

I searched the information in forum again and try to solve it myself.
i adding the "length of list" as attached and error again (The operation length of list cannot accept the arguments: [150] )

It is good that it can show the row [150] only, but how can solve this bad arguments?

Thanks

error2.PNG
update1.PNG

MrLam

unread,
Jun 1, 2016, 4:33:36 AM6/1/16
to MIT App Inventor Forum
Hi Taifun / Abraham Getzler,

i am glad to informed you that it is work now !!!!!!
i tried many many times and now can show the row only. (see attached)

highly appreciated for your help!  :)

Thanks!



done.PNG

Abraham Getzler

unread,
Jun 1, 2016, 12:50:38 PM6/1/16
to MIT App Inventor Forum
Glad you got it working.

Is this a currency conversion application?

I notice you expect only one row in your table, and the column name includes a currency type?

What will happen to your program if you need to add a new currency type?

Will the program still work, or will it have to be changed?

The program is the lawn mower, and the data is the lawn.
You shouldn't have to send the lawn mower back to the factory to mow a new lawn.

ABG

MrLam

unread,
Jun 1, 2016, 9:56:16 PM6/1/16
to MIT App Inventor Forum
Hi ABG,

Much appreciated that you are keeping to check my procedure and follow it.  Awesome!

In fact it is not a currency conversion application but a trucking price depending on different places for data purpose.
i have tested for more than 3 columns and succeeded. (it is totally 18 columns i need to entry)

I hope it will work finally.
anyway - nice to meet you here.

MrLam from Hong Kong.



Reply all
Reply to author
Forward
0 new messages