And now after several weeks, we will talk about the back-and-forth to navigate inside our gallery.
How are we going to apply the back-and-forth functionality? To start we are going to add row numbers to the gallery. We need this numbers to know which item we selected in the database. The formula we use is:
With(): Makes the formula way more readable because you define a scope before you use it in your formula.
After we added a row number we can navigate to the scrn_Item by selecting an item in the gallery. In this screen, we add 3 new controls. An arrow to the right, an arrow to the left, and a text input.
As we discussed in the previous blogs the form in this screen shows the selected item with a lookup in the default property.
In the arrow to the left, we want to go to the item previous to the current one, except if it’s the first item in the gallery. We use the Row number (index) as a reference for what item needs to be shown. The code in this control is:
In the arrow to the right, you want to do the opposite. We want to go to the next item unless it is the last one. So if we reach the last index number we don’t want to look up a new item. The code looks like this:
Now we want also to have the possibility to go to another item by just entering the number in the text input property. This part is a little bit trickier but doable. First, we set the default property with the index number.
When the default property is set, we want to trigger a code when we enter an index number in this control. We can use the OnChange property for this purpose. The code we enter is:
My scrn_item looks like this at this time. Because I combined all topics in the previous blogs on this screen.
Now try it out. We can use this approach for several purposes. You can also think of an image gallery that works in a same way. Done for now, next blog I’m going to demonstrate how to share your app with internal and external users.