7. App design - matteoparlato/Plucky-Phoenix GitHub Wiki
Using parent/child relationships for relative styling
We recommend that you use one control’s style as the basis for styling other controls. In general, use relative styling for the color, fill, x, y, width, and height properties.
Use Containers instead of Groups
Galleries
Use galleries for almost everything that’s repetitive and linear.
The “brute force” (manual placement of multiple controls) method might be faster initially, but it will be very time-consuming to modify later.
If you must present a series of information or controls that seem repetitive, always consider whether you might be able to create a internal collection by using a gallery.
It’s also useful to use a Gallery control as a view form, instead of using a Display Form control.
For example, you have a three-screen “app from data” app. There’s a Users data source that contains the user’s name, job title, and phone number.
The first screen, the User List screen, has a control that’s named galUsers. This control lists all users.
The second screen, the User Details screen, just has a gallery control that’s named galUserDetails. The Items property of this control is set as shown here.
Table(
{Title: "User Name", Value: galUsers.Selected.DisplayName},
{Title: "Job Title", Value: galUsers.Selected.JobTitle},
{Title: "Phone Number", Value: galUsers.Selected.PhoneNumber}
)
This method is much faster than trying to modify three separate data cards in a display form.
Forms
Use forms for repetitive data entry fields.
Forms also let you quickly group several fields instead of having to use several text boxes.
A form is much easier to work with than individual text boxes, because forms let you to take advantage of parent/child relationships to implement relative styling.
Common Data Service for Apps
We recommend that you use a single screen to handle edit/insert operations.
If possible, use a CardGallery control to handle updates to data, instead of referencing individual controls in a Patch function.
When you name context variables, you should indicate which record they’re associated with.
Multiple form factors
When you make the same PowerApps app target both phone and tablet layouts, first create one version of the app, run it through testing, and finalize it. Then convert it to the other version before you modify the layout and screens. This approach helps guarantee that your expressions, controls, variables, data sources, and so on, all have the same names. Therefore, it’s much easier to support the apps and develop them. To learn how to convert one form factor to another, see the How to convert a PowerApp from one layout to another article on Todd Baginski’s blog.