I am new to PowerApps and understood that Gallery is used to show list of records from collection. And for these collection one can choose from the predefined template (and template can be modifed with additional controls)
The individual controls can be made hidden or visible depending on items property value ( for eq. Status / Category).
(The collection of control is treated as data card - in case of Edit Form, per field there is datacard)
Would it be possible that, I can have different template ( data card) for Gallary depending on the items specific property.
If Status is "completed", then i can use data card(template) which is template1.
If Status is "pending" then I can use data card(template) which is template2.
(Something like in WCF , we have can have different template for one list view component and depending on items type specific template get used for displaying data).
Yes, it's possible to display different data cards depending on the value of your 'status' field.
You can use an IF statement to conditionally show or hide cards, and the technique that you would use would be similar to the technique that's shown here.
You cannot have different template for the same gallery because Gallery use a template data card which is the first one to manage and work on the rest of it. But you can make this possible by setting the OnVisible property of the related controls. For example, you use the Image and Title Gallery layout , and set the OnVisible property of Image control inside the first data card to:
Notice that this will only make the image control invisible but there still will be a blank space there. I personally think that this is meaningless because even though you don't set this visible property, if there is no value in Picture column, the image control will be blank too.
If you really need to have different layout for each data card, maybe you could post this idea in the PowerApps Ideas forum, so it might be considered for future releases.
With individual controls in single template, I can hide or show depending on the field.
What I need to show is dynamic form (depending on "Type" column, different controls should be visible )
For eq. ( Label Single line TextBox) , (Label, Multiline TextBox), (Label, 3 - 4 CheckBox), (Label - 3-4 Radio Buttons ) etc.
Placing all these controls and enable/disable them, i think will have a performance overhead, so expecting it would be nice to use the datacard depending on some field.
So one gallay component but depending on item type different template (datapart) will be used. ??
-- Posting the idea is new idea forum.
Check it out!
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
The largest Power BI, Power Platform, and Data conference in New Zealand