How to read a specific cell in google sheet by using App inventor then make it as a started value for Sreen 2?

Hi professors!
I'm a newbie. I dont know much about coding. I have a problem but I can not find the way to solve it from google or youtube.
The story is that I want to set the textbox 1,2,3,4 as the cell c2,d2,e2,f2 from the google sheet (I linked below) when Screen 1 initialize or a Button is clicked and then set it as a started value for Scceen 2 (this step I could afford) But the main problem is that I dont know the way to set these textbox as I mentioned above. Hope to get your help!
Picture for more understand!
Annotation 2020-07-06 205606
textbox 1 is gonna be cell c2
textbox 2 is gonna be cell d2
textbox 3 is gonna be cell e2
textbox 4 is gonna be cell f2


Get a Single Cell from a Google Sheet

Once you have your value back from the google sheet, set this as the start value when going to Screen2

blocks (6)

Sorry but where could I get the Google sheet block?
and the "GID" where could I find it?

in the url address bar

For example:

SHEETID = 1lS6yIgjJtnz4LN7rFopa59mXUB0gh0LUhlqdmgZoP-Q
GID = 816126792

If you only ever had one sheet/grid in your spreadsheet the GID usually = 0

Thank you!
So how about the google sheet block?
I can not find it in the block screen.

It is a procedure....

This question looks like the tip of an iceberg.

What about all those rows under row 2?
When will you ask about showing them too?

Why just meat and fish? Will there be a third and fourth category too?

I just answer the question...:wink:

Hi TIM, I set up the block like this, but in the textbox it doesnt show the result I want. Where am I wrong?


blocks

blocks (8)
blocks (2)

You have included the sheetID twice!!

image

1 Like

Thank you very much! Such a big help from you!
Very thank!

It is a safe practice with long URLs in text boxes to duplicate them, cut them into front and rear halves, and text JOIN the pieces, so that every part of the text is visible in the Blocks Editor.

1 Like

Hi Tim,
How could I do to pass many values from screen1 to screen2?
I do like this but it does not work.
Annotation 2020-07-08 093031Annotation 2020-07-08 093010

The start value block is a waste of time, if you have more than one value to pass to another screen.
It's too much trouble to pack them all together and then to have to unpack them when you arrive in the other screen.

It's simpler to take each value and store it into its own TinyDB1 tag, like 'MEATPRICE', 'MEATCOMMISSION', etc, and retrieve from TinyDB1 directly into the appropriate Label.Text on arrival, one by one.

In this case, that would be 4 tags, 4 storage blocks, and 4 TinyDB1 read blocks on arrival.

1 Like

Thanks, I got it!

you might want to read tip 1 here

probably you then prefer to use only one screen together with virtual screens?

Taifun


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

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.