Data viewer grid move to next cell

Please help!!! I am using data viewers grid. When i click on an image it moves to another screen and shows the image with a title from airtable connection. With a button i want to move to the exact next image from the data viewer grid.
For example if i selected the 5th image i want to move to the 6th. The problem is always it goes from the first one…
If i use the change rowID by 1 it goes from 0 to 1. But i want to go from the image that i clicked on the next one.

Please someone give help

You need to keep track of which data viewer grid item was clicked. That’s what the green “index” block is for. Set a variable value to the green “index” block and then use that variable when you are displaying an image.

So if you click on a grid item and it was, let’s say, number 5, then the index will equal 5 and you could see the variable called currentImage to the “index” block. So that variable will also have the value 5.

Then, when clicking the “next” button to show the next image, use currentImage+1 to determine which image to show.

1 Like

Many thanks for your reply

At the moment i am here:
The first image is in the data viewer grid scene while the second in the screen that shows the details about image and title.

Data viewer grid

But still doesnt work and it goes from the first image every time.

RowID+1 only works with Google sheet. It does not work with Airtable or Local Data Source as the rowID is an arbitrary code. :grin:

Sorry, good catch there. I’ve been working with Google Sheets and local data sources often and not so much Airtable.

1 Like

So this is part of the solution. It just doesn’t switch the “current image” to the index # of the data viewer grid when you click on an item.

1 Like

I would do it in a different way, I would read the rowID of all the rows in the table and store it in a list.

I would then use [stored current row] as index to the list to get the internal rowID and fetch the image using [get value] block.

Maybe a roundabout way, but it always worked for me. Mind you, I tried it with Local Data Source but haven’t tried it on Airtable.

I tried this solution but instead of showing the image in the same screen i used a second screen. It doesnt work and i think the problem is in the connection between the two screens. Am i not using the right orders to store the initial rowID of screen 1?

Also i am now using google sheets to see if its easier the solution

(upload://vOfGzWl91WB858yOaJYzCekCpm5.png) Screen 1

![Screen 2|242x500]

hello sir, can you make a block sample on this, i will greatly appreciate if you do so, thank you

I already did. What is it you need, exactly? And what have you tried (show a screenshot of your blocks)?

1 Like

sir good day, i want that if i will click my map marker, i will navigate to a link
heres my table

and my blocks, already ok, is shows already the marker

what should i do on my marker press, that i will navigate to a link. thanks

I haven’t really worked with map markers. I guess you’d use the onPress event:

You’d have to know which marker the user was clicking and then you could open the corresponding link in the Airtable database.