web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How i can know which n...
Power Apps
Suggested Answer

How i can know which navigation component link the user clicked

(0) ShareShare
ReportReport
Posted on by 2,011 Season of Giving Solutions 2025
I have a navigation component to build a left hand side menu for my app, now inside the app on start i added the menu items, something as follow:-
 
ClearCollect(
    MenuItems,
    Table(
   
    {
        ID: 24,
        HMenuLbl: "Work Orders List",
        Screen: 'Work Orders List',
        Icon: Icon.Alarm,
        HSubMenuVisible: false
    },
    {
        ID: 25,
        HMenuLbl: "Limits",
        Screen: 'Tickets Limit List',
        Icon: Icon.Alarm,
        HSubMenuVisible: false
    },
   
    {
        ID: 35,
        HMenuLbl: "New & Assigned Cleaning Work Orders",
        Screen: 'Work Orders List',
        Icon: Icon.ListScrollWatchlist,
        HSubMenuVisible: false
    }
    )
);
 
 
now as shown above I have 2 navigation items which take to the same screen (Work Orders list). so how i can know which menu item the user actually clicked on? as i need to set some global variables on each click..
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,316 Super User 2026 Season 1 on at
     
    Assuming you're displaying the menu items in a gallery, just set a variable on the gallery items OnSelect:
     
    Set(gblSelectedMenu, ThisItem)
    you can handle the navigation directly in the Gallery's On Select using an If or Switch statement, for example:
     
    Put below code on Gallery on select property:
    Set(gblSelectedMenu, ThisItem);
    
    Switch(
        ThisItem.HMenuLbl,
        
        "Work Orders List",
        Navigate(Screen1),
    
        "Limits",
        Navigate(Screen2),
    
        "New & Assigned Cleaning Work Orders",
        Navigate(Screen3)
    )

    You can replace Screen1, Screen2, Screen3, etc. with your actual screen name. This way you're storing the clicked menu item first and then using HMenuLbl in a Switch() statement to handle the navigation.

     

    ---------------------------------------------------------------------------
    Glad it helped 🙂
    If this fixed your issue,
    please click “Does this answer your question?” to mark it as verified so others can find the solution easily.
    A Like 👍 is always appreciated, and I’m around if you need more help @Kalathiya
  • johnjohnPter Profile Picture
    2,011 Season of Giving Solutions 2025 on at
    @Kalathiya thanks for your reply. but i am not using a gallery i am using a navigation component as follow to show the left side menu :-
     
     
     
    and here is the component:-

     
     now i can say Set(Navigation Component_1.SelectedMenuItem) which will return the number of the item, but i have different Navigation Component on each screen, so i can not know which one the user click on. and i have 35 screen , which means 35 navigation component controls
  • Kalathiya Profile Picture
    2,316 Super User 2026 Season 1 on at
     
    First select the component and enable the "Access app Scope".
     
    then you can able to write the above code on Menu - component.
     
    For example:
     
    If this helped resolve your issue, please click “Does this answer your question?” so the solution is marked and easier for others to find.
  • johnjohnPter Profile Picture
    2,011 Season of Giving Solutions 2025 on at
    @Kalathiya i do not see the option to "Access App scope"
  • Kalathiya Profile Picture
    2,316 Super User 2026 Season 1 on at
     
    Go to Component -> Select your menu component - on left side property you can able to find the "Access App scope"
     
    Else, could you please select the component and share the screenshot of your screen..
  • johnjohnPter Profile Picture
    2,011 Season of Giving Solutions 2025 on at
    @Kalathiya here is the settings , thanks again for your help
     
  • Kalathiya Profile Picture
    2,316 Super User 2026 Season 1 on at
    Hello @johnjohnPter

    I have just reviewed the Microsoft blog, and it mentions that if you are using a Component Library, the Access App Scope option is not available unless it is enabled at the Component Library level.

    Could you please try creating a new component and check whether the Access App Scope option is available?

    basically use of this property is that it allows you to access variables, collections, and other app level data within the component.

     

     

     

  • Suggested answer
    RaghavMishra Profile Picture
    97 on at
    Hi johnjohnPter,
     
    Great question, and Kalathiya's Switch approach is spot on! To add a bit more context from the Microsoft Learn docs:
     
    The standard pattern for tracking which menu item was selected is to use a global variable set in the gallery's OnSelect, then use the Navigate function to route to the appropriate screen.
     
    If you also want to pass context data to the target screen (for example, the selected menu item ID or label), you can pass it as a screen parameter using Navigate. According to the Navigate function docs, you can pass a record of named values to the screen:
     
    Navigate(Screen1, ScreenTransition.None, {selectedMenu: ThisItem.HMenuLbl})
     
    The receiving screen can then read the value using the Param() function or directly from the passed record, depending on how the app is structured.
     
    One additional tip if you are building this as a reusable component in a Component Library: the Navigate function cannot be called directly inside a component unless the Access App Scope property is enabled on the component. This setting is available in the component's properties and must be turned on explicitly at the component library level. Without it, navigation calls inside the component will fail.
     
    References:
     
    Found this helpful? Please mark "Does this answer your question?" so others searching for the same issue can find it quickly. A thumbs up on "Was this reply helpful?" or a Like is also much appreciated!
     
    Raghav Mishra — LinkedIn | PowerAI Labs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 387

#3
timl Profile Picture

timl 344 Super User 2026 Season 1

Last 30 days Overall leaderboard