cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jchris207
Frequent Visitor

Problems Navigating a BrowseGallery of Sharepoint List "Top Item"

Hello and Good Evening,

 

Long-term lurker for about a year, and about this time last year I began my current development. I have built a custom gallery app that is powered by a Sharepoint List as the item database. The main BrowseGallery works without a hitch- that is, clicking an item in the BrowseGallery list Selects the Parent, Sets the correct Item, adds +1 to the "totalclicks" to track my Top 10 Entries, and Navigates accordingly:

 

 

 

Set(currentRecord, LookUp(SHAREPOINT_DB, TOPIC = ThisItem.Title));
Patch(SHAREPOINT_DB, currentRecord, {TotalClicks: currentRecord.TotalClicks + 1});
Navigate(DetailScreen1, ScreenTransition.UnCover)

 

 

 And the gallery Items are populated via:

 

 

 

Filter((SortByColumns(Search(SHAREPOINT_DB, TextSearchBox1.Text, "ANSWER", "CATEGORY","TOPIC","HOWID","LINK"), "CATEGORY", If(SortDescending1, Descending, Ascending),"TOPIC", Ascending)),!IsBlank(TOPIC),CATEGORY in ComboBox2.SelectedItems)

 

 

However, when I am in the "Top 10 Entries" list, clicking any of the gallery Items brings me to the very first Item in my 'SHAREPOINT_DB' instead of selecting the correct entry. The Items in this "Top 10" list are populated via:

 

 

 

FirstN((SortByColumns(colNumberedSHAREPOINT_DB, "TotalClicks", Descending)),10)

 

 

However the OnSelect for each item in this "Top 10" BrowseGallery is the same code as above for the main BrowseGallery.

 

Any suggestions or solutions to why the navigation inside my "Top 10" list only navigates to the first entry in the list instead of setting the correct record and navigating accordingly?

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

If the gallery with the top 10 is gallery2, the item property of the display form should be Lookup(Sharepoint_DB, ID=gallery2.Selected.ID)

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

If the gallery with the top 10 is gallery2, the item property of the display form should be Lookup(Sharepoint_DB, ID=gallery2.Selected.ID)

Thank you! I figured it was something easy.. I ended up using SET to create a tracking variable for whichever browsegallery I was navigating from in the OnSelect:

 

Set(lastScreen, "topten")   or   Set(lastScreen, "main")

 

...and then used the value of the variable with a SWITCH to determine the population of the datacards Items from the correct browsegallery:

 

Switch(lastScreen, "main", BrowseGallery1.Selected, "topten", BrowseGallery4.Selected)

 

 

Thanks for the suggestion and pointing me in the right direction! Works like a charm now 🙂

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,133)