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
Pstork1
Dual Super User III
Dual Super User III

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 III
Dual Super User III

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

Pstork1
Dual Super User III
Dual Super User III

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,785)