cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lgpower
Helper II
Helper II

Select(Gallery,row,control) in OnSelect to select one items' button within gallery

Hi there, 

 

I have two navigation galleries. One for mobile one for horizontal layouts. Both galleries have the following items:

 

Table(
    {
        Title: "";
        Icon: "";
        Context: "logo"
    };
    {
        Title: "";
        Icon: "";
        Context: "vorigScherm"
    };
    {
        Title: "Startpagina";
        Icon: Icon.Home;
        Context: "showDashboard"
    };
    {
        Title: "Weekstaten";
        Icon: Icon.Clock;
        Context: "showMijnWeekStaten"
    };
    {
        Title: "Projecten";
        
        Icon: Icon.Folder;
        Context: "showProjecten"
    };
    {
        Title: "Urenoverzichten";        
        Icon: Icon.LogJournal;
        Context: "showGoedkeuren"
    };
    {
        Title: "Ploegen portaal";       
        Icon: Icon.People;
        Context: "showPloegen"
    }
)

 


Based on ThisItem.Context field actions are performed such as navigating and updating collections. 

 

In my mobile navigation I want to have the exact same actions. Of course I could just copy paste the OnSelect code but I think a cleaner solution would be to use Select(Gallery;Row;Control). Someting like this: 

Select(
NavigationVert;
LookUp(
NavigationVert.AllItems;
Context = ThisItem.Context
);
navigationSelectControl
)

Unfortunately I cannot get this to work. Is it possible to select a variable row+control from a button in another gallery? 


Thanks in advance. 

LGpower 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @lgpower ,

 

You could insert a number column in your second gallery.

 

I assume that the formula in the items property of your second gallery control 'NavigationVert' is:

Table({AAA:"a";BBB:"b"};{AAA:"c";BBB:"d"};{AAA:"e";BBB:"f"})

 

 

So, you should change the above formula to:

Table({AAA:"a";BBB:"b";Numbercolumn:1};{AAA:"c";BBB:"d";Numbercolumn:2};{AAA:"e";BBB:"f";Numbercolumn:3})

 

Then you could use this formula:

Select(
NavigationVert;
LookUp(
NavigationVert.AllItems;
Context = ThisItem.Context
).Numbercolumn;
navigationSelectControl
)

 


Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

4 REPLIES 4
rubin_boer
Super User
Super User

hi @lgpower just to clarify, when you click on the item you wish the navigation to take you to the form as per Context? if this is the case:

on the Onselect of the gallery, OnSelect = Navigate(ThisItem.Context,Transition.cover)

 

If you looking for something else, please explain a bit more.

 

hope this helps

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Hi @rubin_boer,


Thanks for your reply.

Actually, I have most galleries within same screen. So one of the actions in the OnSelect is OnSelect = UpdateContext({showScreen:ThisItem.Context}) 

 

But yes, that is the general idea. 

So this works for the Vertical Nav (no issues navigating what so ever).

What I am trying to achieve is  the same behaviour in the horizontal Nav using OnSelect = Select(verticalNav,Row/Column,Control) 



rubin_boer
Super User
Super User

@lgpower im not 100% with you, do you mean the vertical control of the gallery itself?

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
v-xiaochen-msft
Community Support
Community Support

Hi @lgpower ,

 

You could insert a number column in your second gallery.

 

I assume that the formula in the items property of your second gallery control 'NavigationVert' is:

Table({AAA:"a";BBB:"b"};{AAA:"c";BBB:"d"};{AAA:"e";BBB:"f"})

 

 

So, you should change the above formula to:

Table({AAA:"a";BBB:"b";Numbercolumn:1};{AAA:"c";BBB:"d";Numbercolumn:2};{AAA:"e";BBB:"f";Numbercolumn:3})

 

Then you could use this formula:

Select(
NavigationVert;
LookUp(
NavigationVert.AllItems;
Context = ThisItem.Context
).Numbercolumn;
navigationSelectControl
)

 


Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,743)