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 / Navigate with lookup d...
Power Apps
Answered

Navigate with lookup does not pass context variable

(0) ShareShare
ReportReport
Posted on by 37

 Hey everybody,

 

I have an issue and can't get to the root cause of the problem. I have collection (NavigationCol) which holds the business logic of my app, which means where to navigate when buttons are pressed. At the same time I want to pass a context variable to the destination screen. When i try to use the NavigationCol-logic by LookUp() and pass it to the OnSelect of the Button, the navigation part of the navigate()-functions works, but the context is not set. When I directly use the destination screen (Screen6), the context variable is set correctly.

<Navigate(LookUp(NavigationCol; ActiveScreen=App.ActiveScreen.Name).DestinationScreen; ScreenTransition.Cover; {VarContTest: "Test"})>

<Navigate(Screen6; ScreenTransition.Cover;{VarContTest:"Test"})>

 

Any suggestions?

Thanks in advance!

Categories:
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @winj945 ,

    The cause of the problem is that you simply cannot refer to Power Apps objects (Screens, Forms, Controls or Fields) dynamically.

    You would need to hard-code the screen names with the required logic.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • winj945 Profile Picture
    37 on at

    Hi @WarrenBelz,

     

    thank you for the quick answer. I was not aware of the fact that it's not possible at all, cause just the navigation part without passing the context variable works perfectly:

     

    (Navigate(LookUp(NavigationCol; ActiveScreen=App.ActiveScreen.Name).DestinationScreen; ScreenTransition.Cover).

     

    Am I missunderstanding your answer? I'm pretty new to Power Apps and it might be that I'm missunderstanding something really  basic 😉

     

    Regards

  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @winj945 ,

    You may have found the one (sort of) exception to the rule. How do you collect NavigationCol and what is in it?

    As you are using what is certainly a custom syntax, it could be that Power Apps did not envisage this structure.

    Have you thought of making the variable Global and simply setting it in the code?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • winj945 Profile Picture
    37 on at

    Hi @WarrenBelz ,

    yes I already thought about a global variable but I'm not sure whether this is the best option because the varibale value is specific to every screen (more than 60). This would result in many global variables...

     

    Thank you for your suggestions.

  • Verified answer
    WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @winj945 ,

    As you have correctly pointed out, the syntax you are using for passing the variable is correct in placement and content and you are not getting any errors. There is also no other pattern that I know of that achieves the desired result. This is a bit of a stab in the dark, but try the below

    With(
     {
     wScreen:
    	 LookUp(
     NavigationCol; 
     ActiveScreen=App.ActiveScreen.Name
     ).DestinationScreen
     };
     Navigate(
     wScreen;
     ScreenTransition.Cover; 
     {VarContTest: "Test"}
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • winj945 Profile Picture
    37 on at

    @WarrenBelz ,

     

    Thanks, I'll try it out!

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard