When the user presses an item in the data view grid, printing the item that the user has pressed

lets say on the data view grid he pressed apple , i want to write apple on google sheet at certain cell.

What blocks have you tried already?

You can learn more about the Data Viewer Grid here: Data Viewer Grid - Thunkable Docs

You’ll need to use the “row id” block to get the value such as “apple” from your data source. See if you can display that in a label. If that works, then move on to updating a Google Sheet cell.

image
this code block works , but i want to improve it . i want to improve that .


this is my data grid
when i press bahrain i want to write bahrain to google sheet.is this possible

Yes, it’s possible. Use this block:

image

You can see an example in the documentation I linked to above. Assign the green row id block to a variable and then use that variable as the for row id value in your update value in block that is in your screenshot.

If you need more help, post a screenshot of what you’ve tried and explain what happens when you try it. Note that I recommended that you first assign the value you’re getting from the data viewer grid to a label so you can troubleshoot that step.

Have you watched the video I linked to?

i did

image
i was already using this block , and it works fine i can write .
but what i want to do is when the user presses the bahrain i want to write bahrain
when user pressed Italy-Imola i want to write Italy-Imola

am i clear?

It seems like I’m helping two different people… unless both accounts are owned by the same person?

Okay, so just get the value from the data source using app variable rowID and then display it.

yes sir both of the accounts are mine

Thanks for explaining that.

Use this block and replace “id” with your `app variable rowID". Assign the value to a label or update a Google Sheet cell with it.


not working(i want to update the value at A2

You can’t use the same variable for the row ID and the value you want to get.

Do set app variable raceValue to get value from Data viewer_final (or whatever you want to call that variable) and then on the next screen, update the value with that variable in the to value section.

changed it like this still not working



@tatiang

That doesn’t make sense to me. You’re having the user select an item, then getting a value from a data source cell and then saving the same value back to the same cell.

Are you using two different data sources or just one? What do you want to happen when the user clicks the data view grid item? It seemed like you wanted to update a cell in Google Sheet with the value retrieved from the data source. But I would assume you want a different cell to be updated.

sorry for very late reply i worked it out