cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jaan1008
Regular Visitor

take selection to next item

 

 Here is the problem, I have a MAIN PAGE (browsergallery) to select the register that I want to see, then I have an icon (next arrow) in the PAGE 2 which brings me into the MAIN PAGE where I can select the next item, all manually. However, I would like to code a button in the PAGE 2 to bring me right into the next item without going to the MAIN PAGE again. Here is the code I came up with but not sure how to finish it:

 

Navigate('pagina de busqueda'; ScreenTransition.Fade;UpdateContext() 

 

this is the code in field "items": 

SortByColumns(Filter(Search(Tabla1;TextSearchBox1.Text; "Apellidos_x0020_y_x0020_nombres_x0020_del_x0020_paciente";"cedula");"2015" in Fecha_x0020_Trasplante);"Fecha_x0020_Trasplante";If(SortDescending1; Descending; Ascending))

 duda power.jpg

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi Jaan1008,

 

So far, I haven’t found a way to navigate to next item directly. Per my certain knowledge, it seems that there is also no functions can be used to navigate to the next item


Please consider to create a feature on PowerApps Ideas Forum, I will also report it from my side.
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

I am trying to find a solution on this issue, I will back if I got one.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yamao-msft
Community Support
Community Support

Hi Jaan1008,

 

So far, I haven’t found a way to navigate to next item directly. Per my certain knowledge, it seems that there is also no functions can be used to navigate to the next item


Please consider to create a feature on PowerApps Ideas Forum, I will also report it from my side.
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

I am trying to find a solution on this issue, I will back if I got one.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Charles_John
Advocate II
Advocate II

Hi,

 

Just adding other options for anybody interested, they are work arounds and not a solution to the next button.

 

Formatting Solution:

 

Using a Gallery Control you can set the size of one item in the control to the entire control size. This give the appearance of a one-item-per-screen look. You can then add some further user controls by setting the 

 

ShowNavigation = true
Snap = true
ShowScrollbar = false
Layout = Layout.Horizontal

That would then have arrows users could click to snap to the next gallery item. Not a replacement for a "next" feature, but an option.

 

 

 

Data Solution:

 

If you have the ability to change your source data and you are NOT re-sorting in the app, you could add a column in the source table that just acts as a row number tag (1, 2, 3, 4, . ..  N) for each record. Haven't validated this, but i think the theory should work, and as long as you are only filtering your data it should be fine. If you are sorting your data this won't work.

 

Then if you want a next button:

 

OnSelect: 

UpdateContext({lngActiveRecord: lngActiveRecord + 1})

 

And any controls that feed off of the data, set their items property to:

LookUp(SourceTable, CounterField >= lngActiveRecord, ReturnField)   

 

RusselThomas
Microsoft
Microsoft

Hi @Jaan1008 ,


Doable, with some limitations depending on your source - and assuming I'm understanding what you want correctly Man LOL

 

If you're happy to use the Gallery as your source, you can either create an index for it like @Charles_John  suggested and move up and down that way or just use the built in ID column of the SPO list.

 

On the Gallery arrow button that takes you to your detail page, Onselect: property

Navigate('pagina de busqueda'; ScreenTransition.Fade; {currentItem: ThisItem})

Then, on your view detail page, the Form Item: property

currentItem

Then, still on your view detail page - the "Next Item" button/icon OnSelect: property

UpdateContext({currentItem: LookUp(browsergallery.AllItems, ID > currentItem.ID)})

and on the "Previous Item" button/icon OnSelect: property

UpdateContext({currentItem: Last(Filter(browsergallery.AllItems, ID < currentItem.ID))})

When you return to the Main page, you will still be on the original selected item though, so you may want to address this by setting the default value of the Gallery to currentItem as well and resetting it when you come back - but we can deal with that only if required 🙂

 

Hope this helps,


RT

jvanrossum
Advocate IV
Advocate IV

Here is an other example with a next (or prev) button to go to next row from the gallery

PowerAppsNext00.png

fred-weidle
Frequent Visitor

Please consider this feature for Next and Previous record.

Anonymous
Not applicable

Thanks for this quick solution! I'm having a problem when you get to the very beginning or end of the list with the next buttons. They do not stop at the first/last item. If I hit next again it pulls up the same details screen but with blanks where the information would be. Do you know how you might limit the buttons not to go past the first/last items in the list? I am using a Sharepoint list. I tried an if statement but kept getting errors.  

 

Thanks!

Anonymous
Not applicable

 
 
 

Thanks for this quick solution! I am having a problem when getting to the beginning or end of my list using these buttons. If I am on the first item in the list and click the previous button, the detail screen will update, but all of the places there should be text is empty since I guess it is trying to find an item before the first item. The same thing happens when I get to the last item on my list. I have tried using if statements to limit the buttons, but I keep getting errors. Any ideas on how to fix this?

Thanks!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,956)