This is possibly more of a Google thing than an Ai2 thing, but a neat trick nevertheless. My requirements are often solved by use of Google Forms, but they do not often present the best way for my users to enter data, and I prefer the flexibility of Ai2 to present a user interface. I came across a blog post by Justin Gale who had figured out how to automatically submit a Google form using pre-filled urls, and it crossed my mind that I could build the pre-filled url from data supplied in an AI2 app.
whilst the automatic submit version would look like this:
You replace the viewform element with formResponse and add &submit=Submit to the end.
To begin, you will need to create your Google Form, which in turn will create the responses spreadsheet on Google Drive.
Here is a sample form, and the responses sheet that goes with it:
A normal prefilled url would look something like this:
whilst the automatic submit version would look like this:
You replace the viewform element with formResponse and add &submit=Submit to the end.
Now to the app
Create an app with some list pickers that match the questions on the form. You can always do more code to automate this so that they link with the form. Also add a Web component
Next set up your blocks as in the following picture, building the Web1 url from the listpicker responses, and include a Web1.get call
You could work in a response if you needed confirmation, but it works without one.
To my mind this is a simpler method of collecting data and storing it in a spreadsheet than other methods I have used. It does rely on web connectivity, but you could use a tinydb to store the data until a connection is available.
aia attached :)
ไฟล์แนบ (1)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น