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 Context Variable
Power Apps
Answered

Navigate Context Variable

(0) ShareShare
ReportReport
Posted on by 57

It seems I can't pass a variable via navigate any longer.  No matter what the variable is, I get the same error: "Context variables cannot be used here.  Context variable can only be bound to a single, specific screen".  Anyone else see this?Capture.PNG".

Categories:
I have the same question (0)
  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Maybe we need more details? Where are you putting this property and on what type of control?

     

    I just created a button and for OnSelect I did Navigate(Screen2,ScreenTransition.Cover,{BestPowerAppsConsultingCompany: "PowerApps911"}) and it works.

  • tdupton Profile Picture
    57 on at
    I’ve tried OnSelect on a gallery and OnChange of a dropdown. Both give me the same error. I’ve tried the web client and Windows client with same results. I’ve done this dozens of times before so I don’t know if it’s some sort of a new bug or if I’m just having a senior moment.
  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    ThisItem.Screen is what is confusing me. Try hardcoding Screen1 (or whatever your screen name is) and see if that works.

  • tdupton Profile Picture
    57 on at

    The gallery is filled with a collection.  That is where the thisitem.screen comes from.  Here is the collection:

     

    ClearCollect(PanTypes,
    {Name: "Salary Change", Screen: PANSalaryChangeScreen},
    {Name: "Transfer", Screen: TransferPanScreen})

  • tdupton Profile Picture
    57 on at

    But, you know what, that was it.  I hardcoded a screen and it worked fine...I know I've set up a collection like this before and it worked fine.  Is there a syntax issue?

  • Verified answer
    Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    I have never gotten a function to accept data like that or via a variable. It annoys me a lot. 🙂 

     

    What you would have to do is make your Onselect an If.

     

    If( ThisItem.Name = "Salary Change", Navigate(PANSalaryChangeScreen,Cover),

    ThisItem.Name = "Transfer", Navigate(TransferPanScreen,Cover)

    )

     

     

    Something like that should work.

  • tdupton Profile Picture
    57 on at

    Thanks for the quick response, Shane.  That's a pain in the butt!  Smiley Frustrated


    I hope they offer something like that for us soon.

  • Slaverty Profile Picture
    218 on at

    Or a switch for little easier on the eye.

     

    Switch(
     ThisItem.Random,
    "Screen1",Navigate(Screen1, Fade),
    "Screen2",Navigate(Screen2, Fade),
    "Screen3",Navigate(Screen3, Fade),
    "Screen4",Navigate(Screen4, Fade)
    )

      Really annoying we can't just put the variable straight into the Navigate though.  Another use case, I have a Middle-Man screen hop where control property variables (colour, size ect) are defined on splash.  Some of these are taken from a "User Settings" table.  When user changes settings, it hops back to splash to re-do all the property variables then hops back to the screen the user was last on.

     

    I had hoped I could just define a global variable containing the current screen's name on the OnClick of the Settings button (eg Set(gloSettingsReturn, Parent.Name)), then simply have Navigate(gloSettingsReturn) on my splash page, but nooo. Now I need a big fat Switch.

  • NicolasK Profile Picture
    Microsoft Employee on at

     What is strange is that it was working previously. I've got an app that I built about 2 years ago. Some formula involved variables to define the navigate screen and it was working perfectly fine. I updated the app today, and now I have this error 😞

  • rschneider Profile Picture
    77 on at

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard