cancel
Showing results for 
Search instead for 
Did you mean: 

Component should access screen's controls and screens

Hello Community,

 

I was trying to create Hemburger menu in PowerApps and wanted to display 3 buttons:

1. Home

2. Sync New Data

3. Sorting

 

So first option is for navigating main screen, but when I write navigate function on click of that Home button - Its displays error as Navigate function having invalid argument as that screen is not accessible from Component creation screen.

 

Refer screenshots to get more idea: 

PowerApps Component.png

 

I would like to discuss if you have some doubts or concern or some solution to this.

 

Note that: Dont want work around, i want to way to make this possible with Component.

 

Status: New
Comments
Level: Powered On

This is already possible as is (no workaround needed). I’m doing this on my current project. But in order to pass something (anything) from the app to the componant, you need to declare a property. Componants use input and output properties to talk to the outside world. This makes for a clean interface (in the programatic sense) between the componant and the app it resides in. Remember that componants are built so you can bring them from app to app, so they can’t assume (by design) things about the environment they reside in (like the presence of a screen). It’s the same reason why componants don’t have access to the app variables.

The proper way to achieve what you describe is just to declare a property at the componant level (say scHome) of type screen and it’ll appear in your formulas. In the app, just set scHome to your ‘Main Screen’. Voilà Smiley Happy

Fair warning : there are still some bugs with the componant feature. It’s got a lot of potential, but it’s still a bit rough on the edges at the time if this writing. I had to backtrack on a primarly componant-based app 2 weeks ago and go back to simple controls.