如何从Google Fusion Table获取RowID [英] How to get RowID from google fusion table

查看:93
本文介绍了如何从Google Fusion Table获取RowID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在将Google Fusion Tables与App Inventor一起使用,因此除了"Pizza Party Tutorial"外没有太多信息.我一直在研究SQL解决方案等查询格式,但似乎似乎无法正确地做到这一点.我正在尝试使用以下代码:

I have been using Google Fusion Tables with App Inventor, so there isn't much info out there other than that Pizza Party Tutorial. I've been looking at SQL solutions and such for the formatting of queries, but I just can't seem to get it right it appears. I am attempting to use the following code:

以便在我的融合表中找到一行的rowid.但是,每当我发送查询时,都会出现以下错误:尝试获取长度为1的列表的项目编号2:(51) 51是我想要的数字,但是由于某种原因它正在访问索引2,但我不确定为什么.

in order to find the rowid of a row in my fusion table. However, whenever I send the query, I get the following error: Attempt to get item number 2 of a list of length 1: (51) 51 is the number I want, yet for some reason it is accessing the index 2 and I am not sure why.

这是我收到结果时运行的代码,但是由于查询显然在访问索引2之类的东西,所以我从未得到结果.我试图将最后一行改为索引2,但仍然遇到相同的错误-索引1仍然存在错误...

This is the code that runs when I receive a result, but I never get a result because the query is apparently accessing index 2 or something. I tried to change the last line to say index 2, but I still got the same error - there's still an error for saying index 1...

推荐答案

FusiontableControl组件异步工作,这意味着您发送查询,并在FusiontableControl.GotResult事件中收到结果.因此,SendQuery方法之后的块没有太大意义...

The FusiontableControl component works asynchronously, which means, you send the query and in the FusiontableControl.GotResult event you receive the result. Therefore the blocks after your SendQuery method do not make much sense...

FusiontableControl.GotResult事件中,您的结果将如下所示

In the FusiontableControl.GotResult event your result will look like this

rowid
51

rowid
51

在该事件中,使用split块在\n处拆分result(新行)以获取列表,并使用select list item块从列表中选择第二项以获取值51.您还可以添加一些错误处理并检查列表的长度是否大于1,然后再选择第二项...

Inside that event use the split block to split the result at \n (new line) to get a list and select the 2nd item from the list using the select list item block to get the value 51. You also can add some error handling and check, if the length of the list is > 1 before selecting the 2nd item...

这篇关于如何从Google Fusion Table获取RowID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆