Pizza Party with Fusion Tables for App Inventor 2 UPDATE BUTTON

401 views
Skip to first unread message

Mohd Ariffin Abdul Aziz

unread,
Apr 13, 2016, 2:50:01 AM4/13/16
to MIT App Inventor Forum
Hello mr Taifun or other expert, can you help me with my project? I want to edit the pizza party with the fusion table to have UPDATE button where when if i click the button, the specific row id in fushion table will updated with new data. 

Taifun

unread,
Apr 13, 2016, 10:19:05 AM4/13/16
to MIT App Inventor Forum
For UPDATE statements the first step to be done is to get the ROWID of the row to be updated with a SELECT statement. The second step is to do the UPDATE.

This example https://puravidaapps.com/fusionDB.php uses the web component and OAuth instead of the built-in fusiontable controls. But you could adjust it to your needs

Taifun

Mohd Ariffin Abdul Aziz

unread,
Apr 14, 2016, 11:32:47 PM4/14/16
to mitappinv...@googlegroups.com
Thank you so much because reply my msg. Actually i have look the example you give before ( https://puravidaapps.com/fusionDB.php) but i cannot understand anything because i am totally newbie with the programming thing. i do not have any basic. I just download the source (aia pizza party) and try to change it a bit. can you help me to make block template so i can edit it. i want to change the submit button to UPDATE button so it can update specific row of my fusion table if certain category on item picker is choosen without add new row. please help me.

Taifun

unread,
Apr 15, 2016, 10:01:58 AM4/15/16
to MIT App Inventor Forum
the Screen1.Initialize block you can find in the Screen1 drawer
 
 
 i cannot understand anything because i am totally newbie with the programming thing. i do not have any basic. 


A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.




Taifun

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



Abraham Getzler

unread,
Apr 15, 2016, 10:03:56 AM4/15/16
to MIT App Inventor Forum
From your drawings, I think you have not done any tutorial(s) yet, or watched any of the very nice YouTube videos showing people building apps.
See the Books and Tutorials section of this FAQ ...


Message has been deleted

Abraham Getzler

unread,
Apr 19, 2016, 10:41:17 AM4/19/16
to MIT App Inventor Forum
Your SELECT statement asks for only one column but you try to extract more than one column from what came back from the SELECT.

Message has been deleted

Taifun

unread,
Apr 20, 2016, 3:27:49 PM4/20/16
to MIT App Inventor Forum

Frequently Made Errors with Fusion Tables Fusiontables and how to fix them


there are 3 errors in your blocks
1. space is missing
2. another space is missing
3. this is not a rowid, you should use the rowid you received previously using the SELECT statement


Taifun

Mohd Ariffin Abdul Aziz

unread,
Apr 20, 2016, 10:30:14 PM4/20/16
to MIT App Inventor Forum
thank you taifun. i have edit it now i faced new error like this. 

Taifun

unread,
Apr 21, 2016, 9:03:09 AM4/21/16
to MIT App Inventor Forum
it seems to be, there are two single quotes after pembaris?


It would really help if you provided a screenshot of your relevant blocks including Do it result of your SQL statement, so we can see what you are trying to do, and where the problem may be.
see also 
Taifun

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


Message has been deleted

Taifun

unread,
Apr 22, 2016, 9:49:54 AM4/22/16
to MIT App Inventor Forum
but when i click update button i face this erroe
remember: the fusiontable control got result event will be executed after sending the select statement AND after sending the update statement
and after sending the update statement you do not like to call your list procedure anymore...
use a global variable action and set it before executing one of the statements, thein in the fusiontabel control got result event check that variable like this

if action = SELECT
then call list procedure
else do something after the update

Taifun

Mohd Ariffin Abdul Aziz

unread,
Apr 25, 2016, 4:24:54 AM4/25/16
to MIT App Inventor Forum
Than you taifun. I not understad much but i just add fusiontable control 2 to the update statement. My project is okay noow. Thanks you so much again.
Reply all
Reply to author
Forward
0 new messages