2017년 8월 4일 금요일

Someone could give me an example in App Inventor 2 to use the web component and insert spreadsheet tables using the URL and see them in my application.


Please SEARCH in this forum before posting your question.   There's a good chance your question has already been asked.

If you are asking for technical help, you must provide the following information:
- Are you using MIT App Inventor Classic, MIT App Inventor 2, or something else (what?)
- What OS are you using? (e.g, MacOS 1.8, Windows 8, ...)
- What browser are you using (e.g, Chrome version 30, Firefox 24, IE 8, ...)
Also provide as much information as you can, such as screenshots and instructions that will let others duplicate the issue.

--
normally you would use the fusiontable component and a SELECT statement 
and the documentation how to create a SELECT statment https://developers.google.com/fusiontables/docs/v1/sql-reference#Select

alternatively you also can use the web component to read data, see screenshot

to display the data in your app, you could take a look at this solution 

--
I have tried your screenshot above to retrieve information from a stored fusion table automatically but I am clearly doing something wrong.  
I have looked at the Pizza tables app and that has been helpful, however I need on this particular screen of the app for the information from the fusion table to be displayed automatically to the user.

--
you forgot the space after FROM

--
Thanks for the 'space' however I now receive notice that it cannot get a response from the table.  
The secure area of the app where information is uploaded to the fusion table still works fine,
sorry for the hassle.


--
your table must be accessible at least by everyone with link
see also the Pizza Party tutorial http://appinventor.mit.edu/explore/ai2/pizzaparty.html

Determining your Fusion Table URL and Table ID
In the blocks editor, you will set the WebViewer component's HomeURL property to point to the URL of your table. To find your Fusion Table's URL:

1. In your browser, navigate to the new Fusion Table you just created.
2. Go to the menu and select Tools > Publish.
3. You'll see a notice saying: "This table is private and will not be visible". Click the blue link that says "Change Visibility".
4. In the list of "Who Has Access", click the blue "Change..." link next to "Private - Only people listed below..."
5. Choose"Public on the Web" or "Anyone with the link". Either of these settings will work for this tutorial. In the future, you should decide this setting based on the sensitivity of your data.
6. Click the green Save button, then the blue Done button.
7. Back on the Fusion Table page, go to the menu bar and select Tools > Publish. Select the URL from the top text box (labeled "Send in an email or IM"), copy the URL and return to App Inventor. 


You will paste the URL into the definition block for the TABLE_URL (see below).

1. You can find the Table ID by browsing to your table, then selecting File>About this table in the menu.

--
Thanks Taifun for your help and patience

--
in response to your suggestion ...to display the data in your app, you could take a look at this solution App Inventor and dynamic table layout with any number of rows and columns
I have spent the evening without success trying yo convert your tutorial to app Inventor 2.  is there any chance you could create the dynamic table using app 2
--
thanks for app 2 solution earlier on today, unfortunately it seems to be confusing me more than ever.  I have used a web component to retrieve the information (you gave me earlier) I have tried in vain to alter the code to no avail.
Please can you have a look and tell me how to adapt the dynamic table code you provided to take from a web component
--
see screenshot and attached modified table example
btw. are you aware, that you can also display the fusion table directly in the webviewer using the table url? see also the Pizza Party tutorial...
i am aware of direct view, i have that on another part of the app, this part the visitors can only see the table i dont want them to be able to edit it.
I will try your solution now, thanks again

--
you are probably getting very bored of me now.... 2 further queries
1. if I am getting my data from a fusion table (xlsx) how can I make that an html file?

2. is the URL of where I am downloading the table from the table URL variable used previously or is that a new url that I need to locate as I'm getting a google error that "400 that's an error.  your client has isseued a malformed or illegal request"
Thanks for your continued patience
--
1. if I am getting my data from a fusion table (xlsx) how can I make that an html file?
xlsx looks like an excel sheet?
the example above gets the data from a fusion table with the web component and displays it with the webviewer using the html file, which previously was downloaded to your device
2. is the URL of where I am downloading the table from the table URL variable used previously or is that a new url
you have to define the table id and API key and use these instead of the table URL, see also the Pizza Party tutorial 
--
I have used your file that you sent me, I have changed the API Key, Table id and URL.  but the result doesn't display in the table as per your example.


--
strUrl is the url, the html file to display the table is downloaded from, this is not your fusiontable url!
strFIlename is the htnl filename to display a table, this is not your table name in the example you only have to change the marked variables, see screenshot

--
According to the previous I did the steps that you had mentioned to me but I could not leave with the mentioned exercise

Here I attach the block and the error that I get when I run the emulator:

Exercise taken from youtube in app inventor clasic

Thanks for all your contributions, I will wait with your help ... !!



--
well, the error message says it all...
you only have two columns... and if you try to get an element from column 3 you get that error

--

댓글 없음:

댓글 쓰기