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

 

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?

 
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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,393)