Fusiontables Control

Non-Visible component
Category Requires Version
Storage API 19, Android 4.4 - 4.4.4 KitKat 4

Overview

A non-visible component that communicates with Google Fusion Tables. Fusion Tables let you store, share, query and visualize data tables; this component lets you query, create, and modify these tables.

This component uses the Fusion Tables API V2.0.

Applications using Fusion Tables must authentication to Google's servers. There are two ways this can be done. The first way uses an API Key which you the developer obtain (see below). With this approach end-users must also login to access a Fusion Table. The second approach is to use a Service Account. With this approach you create credentials and a special "Service Account Email Address" which you obtain from the Google APIs Console. You then tell the Fusion Table Control the name of the Service Account Email address and upload the secret key as an asset to your application and set the KeyFile property to point at this file. Finally you check the "UseServiceAuthentication" checkbox in the designer. When using a Service Account, end-users do not need to login to use Fusion Tables, your service account authenticates all access.

To get an API key, follow these instructions.

  1. Go to your Google APIs Console and login if necessary.
  2. Select the Services item from the menu on the left.
  3. Choose the Fusiontables service from the list provided and turn it on.
  4. Go back to the main menu and select the API Access item.

Your API Key will be near the bottom of that pane in the section called "Simple API Access".You will have to provide that key as the value for the ApiKey property in your Fusiontables app.

Once you have an API key, set the value of the Query property to a valid Fusiontables SQL query and call SendQuery to execute the query. App Inventor will send the query to the Fusion Tables server and the GotResult block will fire when a result is returned from the server.Query results will be returned in CSV format, and can be converted to list format using the "list from csv table" or "list from csv row" blocks.

Note that you do not need to worry about UTF-encoding the query. But you do need to make sure the query follows the syntax described in the reference manual, which means that things like capitalization for names of columns matters, and that single quotes must be used around column names if there are spaces in them.

Permissions

Events

Got Result

Indicates that the Fusion Tables query has finished processing, with a result. The result of the query will generally be returned in CSV format, and can be converted to list format using the "list from csv table" or "list from csv row" blocks.

Params
result Text

Methods

Do Query

⚠ Deprecated

DEPRECATED. This block is deprecated as of the end of 2012. Use SendQuery.

Forget Login

Forget end-users login credentials. Has no effect on service authentication

Get Rows

Gets all the rows from a specified fusion table. The tableId field is the id of therequired fusion table. The columns field is a comma-separeted list of the columns to retrieve.

Params
table ID Text
columns Text

Get Rows With Conditions

Gets all the rows from a fusion table that meet certain conditions. The tableId field isthe id of the required fusion table. The columns field is a comma-separated list of the columns toretrieve. The conditions field specifies what rows to retrieve from the table, for example the rows in whicha particular column value is not null.

Params
table ID Text
columns Text
conditions Text

Insert Row

Inserts a row into the specified fusion table. The tableId field is the id of thefusion table. The columns is a comma-separated list of the columns to insert values into. The values field specifies what values to insert into each column.

Params
table ID Text
columns Text
values Text

Send Query

Send the query to the Fusiontables server.

Properties

API Key

Text ➖ Read Write - Designer Blocks

Setter for the app developer's API key.

Key File

Text ➖ Read Write - Designer Blocks

Specifies the path of the private key file. This key file is used to get access to the FusionTables API.

Loading Dialog Message

Text Default: Please wait loading... ➖ Read Write - Designer Blocks

Setter for the loading dialog's message.

Query

Text Default: show tables ➖ Read Write - Designer Blocks

The query to send to the Fusion Tables API.

For legal query formats and examples, see the Fusion Tables API v2.0 reference manual.

Note that you do not need to worry about UTF-encoding the query. But you do need to make sure it follows the syntax described in the reference manual, which means that things like capitalization for names of columns matters, and that single quotes need to be used around column names if there are spaces in them.

Service Account Email

Text ➖ Read Write - Designer Blocks

The Service Account Email Address when service account authentication is in use.

Show Loading Dialog

Boolean Default: True ➖ Read Write - Designer Blocks

Setter for the loading dialog's visibility.

Use Service Authentication

Boolean Default: False ➖ Read Write - Designer Blocks

Indicates whether a service account should be used for authentication


Last update: January 27, 2020