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 / Power Apps component l...
Power Apps
Unanswered

Power Apps component library - Access App Scope Feature

(0) ShareShare
ReportReport
Posted on by 45

Dear All , 

 

I would like to check with you regarding below feature in Component Library.

 

I have created some components under library with Set function. 

When I try to use library component in power apps ,  Set variables not working due no more "Access App Scope" property in components which we create under library.

 

Anyone can explain , why library component dont have "Access App Scope" property? but we have this property in power apps own component.

Why this different? 

Since we dont have this property in library , I cant reuse my components in other apps.

 

Anyone can give solution for this ? Thanks in advance. 

Categories:
I have the same question (0)
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Subanesh0689 

     

    When you create a local component in your app, you are creating it within the scope of the app which makes it possible to then access the scope (collections, variables, even data sources) by enabling that setting. This is a great feature to have, but the downside is the component is not centralised in a library, which makes it tricky to share and control it given that every copy shared is standalone.

     

    When you build your components in a library, this is great for re-usability and standardisation as it is one master copy. However, they are not created in the context of an app, they are a standalone component, therefore you have no app scope to access when in the component/app studio, hence access to app scope is not available. This makes sense as there is no way for a maker to know exactly in what future apps their component may potentially be used, so there is no way to know at the time of making the component what variables/collections etc would need to be referenced.

     

    With regards a possible solution, it's difficult to advise without specifics on the issue, but if you could share more details of what you are trying to achieve, we will have a look and advise. 

     

  • Subanesh0689 Profile Picture
    45 on at

    Hi AmDev, 

     

    Thanks a lot for your explanation. 

    I have decided to use local component as I need to pass values across app. 

  • PeterCBell_au Profile Picture
    107 on at

    I agree in a sense that using app scope for a lib breaks reasonable rules. Data sources can in fact be attached to a component lib- I guess it is to allow testing.

     

    However, component libs are to allow code re-usability EXCEPT, it seems, for tables and records (without using some sort of terrible hacks which will break the app if the source table changes its schema)

     

    What is NEEDED in a component lib is the ability to define a table and/or record schema for a parameter and/or property using a data source (instead of manually replicating it).

     

    Since an component within an app can have app scope, we can define a record properties schema by setting its default value using Defaults(tblname) or a table property schema by using a default value of Table(Defaults(tblname)). This allows in app components to recognise the fields and their data types when those properties are used elsewhere.

     

    What I would like to see is enabling Defaults(ComponentLibDataSource) function within a component lib where 'ComponentLibDataSource' is a data source defined for the component lib.

     

    If that goes against the grain in terms of breaking app scoping for external libraries, then implement RecordSchema(ComponentLibDataSource) where that function does (essentially) the same as Defaults() but is restricted to use within components.

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 840 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 332 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 275

Last 30 days Overall leaderboard