cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to move to next details screens

I used default template to create an App, in which:
1. Gallery screen with item1, item2, item3...
2. Press an item (ex. Item1) - > move to detail screen of item1.
3. If I want to move to detail sreen of item2, I have to go back to Gallery screen and press item2...

I want to add a button "Next" in detail screen, so that by pressing this button, i can see detail of item2, item3... without having to going back to Gallery screen to chosse the items. Plz help, thanks.
6 REPLIES 6
seadude
Memorable Member
Memorable Member

Hi @Anonymous ,

I'm sure there is a better way to do this, but here is one solution you can try.
NOTE: You will need some kind of sequential ID number in your gallery to make this work. In my example, "record_id" is sequential.

Details Screen:

  • Set the Details Screen OnVisible property to
  • Set(varRecord, BrowseGallery1.Selected.record_id)
  • Add a Right Arrow icon
  • Set its OnSelect property to
    Set(varRecord, varRecord + 1)
  • Set the DetailForm Item property to
     LookUp(BrowseGallery1.AllItems, record_id = varRecord)

As you click the Right Arrow, the variable will increment and the DetailsForm will change. You could create another Left Arrow button and set its OnSelect property to 

Set(varRecord, varRecord -1)

to move back up the Gallery.

 

Good luck!

v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Which data source do you use within your template app? SP List? Excel Table or SQL Table?

Do you want to switch to Next Item detail within your Detail form without going back to Gallery?

 

I have made a test on my side, please take a try with the following workaround:

I assume that there is a ID column in your data source, which is a Auto-Increment type column. And the ID column would be acted as a Row Index in your data source.

 

App's configuration as below:3.JPG

 

4.JPG

 

5.JPG

Within your Detail screen, set the OnVisible property to following:

Set(CurrentItem, Blank());
Set(ItemID, BrowseGallery1.Selected.ID)

Add a "Next" button within your Detail screen, set the OnSelect property to following:

Set(ItemID, ItemID + 1);
Set(CurrentItem, LookUp('20190325_case13', ID = ItemID))

On your side, you may type:

Set(ItemID, ItemID + 1);
Set(CurrentItem, LookUp('YourSPList', ID = ItemID))

 

Set the Item property of the Display Form to following:

If(
    IsBlank(CurrentItem),
    BrowseGallery1.Selected,
    CurrentItem
)

Please take a try with above solution, check if the issue is solved.

 

Please check the following GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank guys!

I think your solutions work well if in Gallery screen there is no Filter or Search, so that the displayed items are in sequencial order.

For my situation, I have many Search and Filter in the Gallery screen, so I will need a more generic solution.

BTW, I am using an excel file for data source.

Hm... You might try moving your Filter() criteria from the Gallery Items property to the OnChange property of the Search bar.

Make a Collection each time the user types in search criteria.

Wrap the ClearCollect with AddColumns to add the “ID” column at the time the Gallery Items are created.

THEN go with the previous recommendation.

I’m on my phone now, so can’t provide details beyond that.

Good luck!
Anonymous
Not applicable

Thank @seadude,

 

Can you give more details on this:

>Wrap the ClearCollect with AddColumns to add the “ID” column at the time the Gallery Items are created.

 

After Filter/Search... I can create a Collection (ex. SubList) based on Gallery: 

Collect(SubList;BrowseGallery.AllItems)

But I donot know how to add an "ID" column with incremental number to this collection.

jvanrossum
Advocate IV
Advocate IV

Here is an example to go to next record from the gallery with buttons on the details screen:
PowerAppsNext06.png

 

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 (2,310)