cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rohittee1
Level: Powered On

PowerApps Gallery Navigation Help

Hello,

 

I have been trying to setup a Gallery that is pulling in data from excel. Each entry would have a button that is selectable that would navigate to a different screen, it would basically act as a drill down interface for project data.

 

I know there has been a few posts regarding this https://powerusers.microsoft.com/t5/PowerApps-Forum/Dynamic-screen-reference-in-Navigation-possible/... is the one I am referencing. Another user asked for clarification but it appears that post might be inactive and I still do not understand a few things. See below my questions;

 

 

ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 })

 

Where would the above be input? Is that just the OnVisible text field for the screen that contains the gallery? If so, does the text in the quotations represent the text in the button or the additional screens?

 

Also

 

Navigate(Lookup(Screens, Name = OtherTablesGallery.Selected.TableRef, Target), None)

 

Is OtherTablesGallery whatever you named your gallery? Default being Gallery1?

 

What is TableRef? Is that the name of the button that needs to be pressed to perform the navigation?

 

When I input the code like so;

Navigate(LookUp(Screens, Name = Gallery1.Selected.OnButtonPress1, Target), None)

This gets input into my OnSelect field in the button in my gallery that will be performing Navigation, however I get an error stating it is an invalid argument type. Am I putting this in the wrong field? It is a navigate command so I am pretty sure it's supposed to go tino OnSelect.

 

Please let me know if you require additional information to answer my questions.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: PowerApps Gallery Navigation Help

Hi rohittee1,

 

About this code: ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 })

 

Please set its to Screen1’s OnVisible property. To use this function, you should create three screens with names Screen1, Screen2, Screen3. Then when you navigate to Screen1, a collection will be created.

 

About this code:
Navigate(Lookup(Screens, Name = OtherTablesGallery.Selected.TableRef, Target), None)


As you said, “OtherTablesGallery” is what you named for the gallery. The default name of a gallery will be galley1, gallery2, etc.


While with the gallery being selected, you could change its name at here, please check the following screenshot:

3.PNG

 

About “TableRef”, it should be a column name on your data source. Say I am using Excel table as data source, and on the Excel file, there is a column named as “TableRef”, then when I set the Gallery’s Items property to the table, I can select the column using the function Gallery1.Selected.ColumnName.

4.PNG

 

I have tested the function on my side, they are working fine. My steps for your reference:


1. Add three screes, Screen1, Screen2, Screen3. Set Screen1’s OnVisible property as ClearCollect(Screens,{Name:"Screen1",Target: Screen1},{Name:"Screen2",Target: Screen2 },{Name:"Screen3",Target: Screen3}).
2. Create an Excel table likes above. Then create a connection to the table. In my case, it is table2.
3. Add a Gallery, set its Items property to table2. Then the items of the table will be displayed on the gallery.
4. Select the first navigate icon, set its OnSelect property as Navigate(LookUp(Screens,Name=Gallery1.Selected.TableRef,Target),None).
Then when you click Screen2 on the gallery, it will be navigated to Screen2. The same with Screen3.

5.PNG

 

Hope this could be your reference.

 

PowerApps Lookup function for your reference:

https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

 

Please feel free reply if you need more help.

 

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

3 REPLIES 3
Community Support Team
Community Support Team

Re: PowerApps Gallery Navigation Help

Hi rohittee1,

 

About this code: ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 })

 

Please set its to Screen1’s OnVisible property. To use this function, you should create three screens with names Screen1, Screen2, Screen3. Then when you navigate to Screen1, a collection will be created.

 

About this code:
Navigate(Lookup(Screens, Name = OtherTablesGallery.Selected.TableRef, Target), None)


As you said, “OtherTablesGallery” is what you named for the gallery. The default name of a gallery will be galley1, gallery2, etc.


While with the gallery being selected, you could change its name at here, please check the following screenshot:

3.PNG

 

About “TableRef”, it should be a column name on your data source. Say I am using Excel table as data source, and on the Excel file, there is a column named as “TableRef”, then when I set the Gallery’s Items property to the table, I can select the column using the function Gallery1.Selected.ColumnName.

4.PNG

 

I have tested the function on my side, they are working fine. My steps for your reference:


1. Add three screes, Screen1, Screen2, Screen3. Set Screen1’s OnVisible property as ClearCollect(Screens,{Name:"Screen1",Target: Screen1},{Name:"Screen2",Target: Screen2 },{Name:"Screen3",Target: Screen3}).
2. Create an Excel table likes above. Then create a connection to the table. In my case, it is table2.
3. Add a Gallery, set its Items property to table2. Then the items of the table will be displayed on the gallery.
4. Select the first navigate icon, set its OnSelect property as Navigate(LookUp(Screens,Name=Gallery1.Selected.TableRef,Target),None).
Then when you click Screen2 on the gallery, it will be navigated to Screen2. The same with Screen3.

5.PNG

 

Hope this could be your reference.

 

PowerApps Lookup function for your reference:

https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

 

Please feel free reply if you need more help.

 

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

rohittee1
Level: Powered On

Re: PowerApps Gallery Navigation Help

That worked! I think part of my problem was related to how I was referencing my table. After following exactly how you did it, I can now have the gallery reference other screens dynamically. 

Thanks again! This is resolved for me.

Labs
Level: Power Up

Re: PowerApps Gallery Navigation Help

Hello,

 

I read your instructions and I think I understood them. However, when I integrate the code "ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 })" to the OnVisible property, no object or collection appears on the Screen1..

 

 Thank you in advance for your precious help ..

 

Bests regards

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,798)