Print

 The layout of the components would look like this:

In the following screenshots we can see how the rest of the components would be:

 

 

 

 

We define four global variables:

 

No ratings of Restaurant 1

Average rating of Restaurant 1

No ratings of Restaurant 2

Average rating of Restaurant 2

No ratings of Restaurant 3

Average rating of Restaurant 3

No ratings of Restaurant 4

Average rating of Restaurant 4

           

The values in the table are obtained from the Table_fusiontable list using the procedures "bulding_global_ratings" and "calculate_average_rating"

 When we start the App we call the "Gluten Free" Table Fusion to obtain its values. Note that it is necessary to indicate the identifier of the table (tableId). On page 17 of this document we indicate where we can find this identifier

After obtaining the result of the query, we save it in the variable Table_fusiontable.

We eliminate the first row of the table since it contains the header of the columns, that is, the Restaurant and Rating texts.

Next, we obtain the length of the table and call the procedure "bulding_global_ratings" (which in turn calls the procedure "calculate_average_rating") to construct the table corresponding to the variable Ratings.

Finally we show the results in the labels Label_R1_average, Label_R1_No_ratings, etc.

The programming block would look like this:

 

 

It should be noted that the previous blocks will be executed again every time we make a query or call to the Fusion Table Gluten Free, that is, every time we press the "Reload" button.

The choice of restaurant is made by pressing the corresponding button

The rating is entered using the slider

 

Finally, by pressing the "Send" button we send the number of restaurant and  rating to the Fusion Table Gluten Free to which they are added in a row.

 

 

 

If we open the Fusion Table Gluten Free in Drive we can see how, effectively, the table increases as we add ratings from the App.

  1. Enter Drive and click on My Drive / More / Connect more applications