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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Referencing Screen con...
Power Apps
Unanswered

Referencing Screen control from within component

(0) ShareShare
ReportReport
Posted on by 5

I'm trying to better understand the capabilities described by this announcement last year: Canvas components can now access app scope directly | Microsoft Power Apps

 

I've created a canvas component, set it to access the App Scope as described in the article above, but I can't figure out how to reference/access controls in the app. A simple example would be to trigger a button in the parent screen, so I was thinking something like "Select(Screen1.Button1);" would work, but it doesn't. Any ideas how I would reference a button in the parent screen?

 

Note: I have successfully seen the ability to share global variables with the app scope enabled, so I know the fundamentals are working.

 

I was assuming this feature would take away the dependence on input/output parameters- so I'm not looking for answers on how to utilize those. 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @PowerThink1 ,

     

    I don't think it is possible to reference controls through a screen. Hence the need for all controls to have a unique identifier.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @PowerThink1 

    In general, using App scope in the component pretty much breaks the concept of a component.  It should be autonomous and able to stand alone in any app.  Having it rely on a control in an app will not allow that.

     

    Although there are times that you just want to componentize something JUST for one app, it is still best to observe the general rules for components.

     

    In your scenario, I would recommend instead creating a Behavioral Action on your component (like an OnSelect), then when the component is used in your app, set the formula on the OnSelect to Select(Button1).

     

    I hope this is helpful for you.

  • PowerThink1 Profile Picture
    5 on at

    Thanks @BCBuizer and @RandyHayes for the replies. 

     

    @RandyHayes I generally think your advice makes the most sense, although with a local component it's often pretty coupled to the host app already. I am still really curious to at least understand what was mean by the note in the article I cited: 

     


     In today’s installment, we are enabling a canvas component to directly access variables, collections, controls, and tabular data sources from its host app

    If you have seen any further documentation or examples on how host (parent Screen) controls could be referenced I'd love to see that!



  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @PowerThink1 

    Well, going back to what you had tried Select(Screen1.Button1) would not have been relevant anyway.  You don't reference the controls in that way.  You can only have 1 Button1 in your app.  All controls are global in scope, so you should have been able to simply do a Select(Button1)

    So, the moral of the story is - if you are creating a local component only that will not be reused and you have that option on for components, then you would simply access any global control in your app from in the component.

  • PowerThink1 Profile Picture
    5 on at

    Thanks @RandyHayes - I can confirm that doesn't work for me. Using a direct reference like Select(Button1) causes the following error, which led me to think maybe there was another way to reference it (it is actually Button3 in my example):

     

    PowerThink1_0-1661533304750.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard