Saving data to sheets

Again Use the companion app

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

ok so I changed some labels and was able to use the do it function but I'm not sure what i need to do once the text boxes pop up?

This method may be helpful to you. But, according to Google policy we should not collect confidential information from users (Anyhow, cross check if my understanding is correct).

I watched and did exactly the same but it still dose not save to sheets. If I do a test and submit form response it dose populate in sheets but when I use the app it dose nothing.

Now compare carefully your url with the guide from @TIMAI2 from here METRIC RAT AI2 - Use AI2 to directly submit Google Form Data

The first delimiter is a ?
All further delimiters are a &

Taifun

I think you have to change the permission in such a way that the form/googlesheet can be seen/read/respond by any one.

Capture

Click the publish button at the right top corner and change the permission as given in the image. This may work.

No you do not

This is for NEW forms only. You must Publish and give Respondents "Anyone with the link" access when you do, so that the form can accept responses.

The Do It on the first text block of the form submission URL reveals the problem.

Compare the invisible end of the first text block with the next text block in the url join.

That first text block should be duplicated three times and broken down into four completely visible parts in the URL join.

I have no idea what I did but it is FINALLY working. Thank you all for the assistance and suggestions

1 Like

You have to change the Share settings (Permission settings) of Google sheet as well as 'Anyone with link'.

Experiment yourself by changing the share settings of Google sheet and form. Don't give permission to edit but give permission only to view or respond.

You do not need to change permissions settings on the google sheet to send data via a google form. The google sheet can remain "restricted" for this operation.

You do need "anyone with the link" permission if you want to download the data on the google sheet to your app using the web component, and if you do not have a google apps script web app in place to handle this operation.

1 Like

@TIMAI2 , So, saving data to google sheet via form will add more security to google sheet, right? (when we use google sheet as database). Because, hackers cannot find the url of google sheet ,they may be able to find only the url of form. Am I right?

I tried now to update data to sheet via form. I set some text value to global variable and put global variable as text input to form. But, it didnt work. Then I added tinyDB to store the global variable values. After that it worked.

You must have got something wrong in your variable settings. You do not need a tinydb to set values to submit data to a google form.

1 Like

When i tested using do it feature, both global variables show the given text values but it didnt get updated in sheet/form. I was not able to find the fault, but worked now. Okay, i shall try to find the issue.

I guess/heard that global variable will not update its value when user enters new value (or when new values are assigned after the app is loaded/logged in by user). So, we have to use tinyDB or we can directly connect text box as input. This may be the reason why my blocks didn't work when I gave global variable as text input. Correct me if I am wrong. :slight_smile:

But, when i tested with do it feature global variables shown text values correctly. So, I don't know.

Yes, noone will know without a screenshot of your relevant blocks

Taifun

1 Like

Actually, the block that I shared above also didn't work when I uninstalled and reinstalled the app again. Then I once more re installed the app and it is working now. So, what I have to understand?

I shall share the previous blocks now (not the one that is shared above).

@TIMAI2 @Taifun
This was the previous block. But, working well now as .apk also. I don't know why these blocks are not working occasionally.

You do not have to store the same information several times, just use the textbox directly. .
Unfortunately we can't see where loginAs comes from. .

Taifun

1 Like