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 / Collection created in ...
Power Apps
Answered

Collection created in a component is unavailable outside of the component

(0) ShareShare
ReportReport
Posted on by 623

Hi wonderful community.

 

I have built a component that contains the following (among other things):

  • A gallery
    • In the gallery I have a checkbox. When you check the box for an item in the gallery, the item is added to a collection using Collect(colSelectedItems,ThisItem.Value)
  • A label that shows all the items for which the checkbox was checked, using Concat(colSelectedItems,Value,", ").

That works as it should, across multiple apps.

 

The problem is that when I use the component in an app, I cannot reference the collection colSelectedItems that is created by the component. It doesn't exist / is unknown within the app, even though the label in the component correctly displays all the selected items. I've tried creating a custom table output property, but I can't set that to colSelectedItems, either.

 

Please please tell me that it's possible to reference the collection outside of the component 🙂 I think I'll have a small breakdown if it turns out that it's just not possible for some reason.

Categories:
I have the same question (0)
  • v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @OliverR-82 ,

    Please turn on the Component's 'Access app scope' function and try again.

    vchengfenmsft_1-1668653576184.png

     

    Here is a link for your reference:

    Canvas components can now access app scope directly | Microsoft Power Apps

     

    Best Regards

    Cheng Feng

  • Verified answer
    OliverR-82 Profile Picture
    623 on at

    Hi @v-chengfen-msft 

     

    Thank you for your suggestion and the reference link. I did not know about that feature. However, in my particular case that is not an option, as the 'Access app scope' property for components is not available for components that are part of a component library, which is the case for me.

     

    In the end I just added two custom output properties for my component that output the data from the collection that I need using the Concat() function. That results in a string output, which is what I need since I need to pass them to a Power Automate flow as text anyway.

     

    If you need to output table data, I figured out that I can do that by adding an output property with data type 'Table', and set that to the following formula:

    ForAll(
     colSelecteditems,
     {Id: Id, Value: Value}
    )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard