cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dee2005
Advocate I
Advocate I

Check if Navigate had any variables passed

Is there a way to check if a variable was passed to a screen.

I have a screen which takes some variables when a record is being edited but doesn't need any variables if its a new record. So my problem is sometimes i navigate from a Gallery and I can pass variable, I sometimes navigate from a menu component where i cant pass any variables. When no variables are passed the screen will use the last variables passed. 

So basically in the on visible of the screen i would like to check what was Context of the Navigate command that brought it to the screen?

Maybe secondly is there a way to pass Context when the Navigate is being done by a component, I can only pass the screen variable but not the context variable, In the component I get this error : 

 

navigate.png

 

No context, works fine:

navigate1.PNG

 

Any help/advice would be highly appreciated.

6 REPLIES 6
Boynog
Helper II
Helper II

Hi @dee2005 ,

 

Better use the Set function.

 

Navigate(ThisItem.MenuNewNavigate, ScreenTransition.None); Set(abc:"abc")

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

 

WarrenBelz
Super User III
Super User III

@dee2005 ,

The problem here is you are trying to dynamically refer to a screen name (I assume you have it in the field name MenuNewNavigate). You cannot do this - you have to use the actual screen name in the Navigate() function.

Back to your initial question, the syntax you are using will pass context variables to the target screen and should work, however for debugging, but a label on the screen with the Variable name and you will see what it is when you navigate to the screen.

 

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.

 

 

WarrenBelz
Super User III
Super User III

Hi @dee2005 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

thanks @Boynog but this doesnt work as I would have to pass the variable name (abc in your example) to the component.

Thanks @WarrenBelz I do pass the actual screens dynamically as i have them in a table, it works for the screens but doesnt work for Context Variables so I have created 2 forms. One when directed from the component (for new records) then I use another for edit when directed from another form in my app. 

 

Appreciate all the help.

Didnt really get the result i want as i wanted to avoid maintaining different screens for new and edit but it will have to do.

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 (3,176)