(Part 8) How to build a Canvas Power App – Back and forth functionality in a gallery

door | 15-11-22 | Learning Lessons | 0 Reacties

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.

Part 9 coming soon!

<– Part 7 – SharePoint button layout
<– Introduction – Index

Gideon Kos

Gideon Kos

Productivity Specialist Microsoft @ ModiShare

Microsoft (Office) 365 enthusiast with extensive experience designing and configuring M365 and SharePoint environments. Gideon is also a Microsoft Certified Trainer and regularly writes knowledge blogs on this website.

0 reacties

Een reactie versturen

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *

Deze site wordt beschermd door reCAPTCHA en Google Privacy Policy en Servicevoorwaarden toepassen.

De verificatie periode van reCAPTCHA is verlopen. Laad de pagina opnieuw.

Microsoft 365 nieuws en updates maandelijks in je inbox?

Met onze Monthly Recap mail ontvang je elke maand onze updates in jouw mailbox.

Per maand