cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ancy
Kudo Kingpin
Kudo Kingpin

How to create a component library for gallery

Hello Everyone,


I am trying to reduce the workload on a single developer by making use of the Component Library feature provided in Canvas Apps. As per the below link we can use the Table to create the Menu Components.


https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component#:~:text=a%20component%....

 

But I do not find the option to select the Data Type as "Gallery" so that I can create a gallery component(as in the below image). Can anyone help me to understand if it is possible to create the gallery as a component? Or how can we create a gallery in a component library?

 

DataType.png


Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions

To the best of my knowledge one of the limitations of components is that you can't embed a data source inside a component.  Instead components work off local tables of data.  You can pass a table of data into and out of a component, but you can't use a connection inside a component.

 

1) Create a custom property of type Table

2) In the component hard code a sample Table in the custom property that matches the fields of the Table you will pass in.

3) Use that Table to configure your component.

4) When you embed the component in your app set the custom input property to the Table of data you wish to pass in.



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

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

You don't create the Gallery as a component.  You create the component library, add a component to it, and then add a Gallery to the component using the Insert Menu. You are looking at the custom property menu of the component.  You add a Table there to be used as the Items collection of the Gallery.

image.png



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

Hello @Pstork1 

 

Thanks for your response.

 

When I try to add the items in the gallery in the Component, I get below error. Can you please suggest how to add the items?

 

ErrorInComponentLibrary.png

 

Thanks

To the best of my knowledge one of the limitations of components is that you can't embed a data source inside a component.  Instead components work off local tables of data.  You can pass a table of data into and out of a component, but you can't use a connection inside a component.

 

1) Create a custom property of type Table

2) In the component hard code a sample Table in the custom property that matches the fields of the Table you will pass in.

3) Use that Table to configure your component.

4) When you embed the component in your app set the custom input property to the Table of data you wish to pass in.



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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,210)