Skip to main content

Intelligent initial selection of fields and prepopulated gallery layouts (Previous Version)

Headshot of article author Anees Ansari

 

Based on the great feedback that we have received from you, the Microsoft PowerApps and Common Data Service teams continue to add features to help app authors quickly create business apps. We are happy to announce the availability of some new features that we hope will further empower app authors to deliver rich end-user experiences with less effort.

Intelligent initial selection of fields for the Gallery, Form and Data table controls

When an app author connects a Gallery, Form, or Data table control to a data source for a Common Data Service entity, the framework now intelligently selects the fields to connect the child controls to. A control, such as Gallery, Form, or Data table, uses the most suitable ordered list of fields using metadata from the Common Data Service. The control then intelligently connects its child controls to fields in that list by using various factors, such as the order of the fields in the list, the type of the fields, and the type of the child controls. Under the hood, we extended the PowerApps connectors in order to provide multiple ordered lists of fields to enable this feature.

Let’s look at this feature in action!

  1. Create a blank tablet or phone app.
  2. On the Insert tab, click or tap Gallery, and then click or tap Vertical.
    A Gallery control is added to the screen. By default, the layout is set to Image, title and subtitle.
  3. Use the layout picker to change the layout of the gallery to Title, subtitle and body.
  4. In the right pane, click or tap CustomGallerySample, and then click or tap Add a data source.
  5. In the list of connections, click or tap the connection for your database.
  6. In the list of entities, click or tap Case, and then click or tap Connect.
  7. A data source for the Case entity is created, and the DataSource property of the gallery is set to that data source.
    The Title control is connected to the CaseId field, the Subtitle control is connected to the Name field, and the Body control is connected to the Status field.
    This configuration provides app authors with a great initial gallery for the Case entity and hopefully reduces the time they spend updating the control-to-field mapping.

Intelligent initial selection of fields for the Gallery control

App authors will have a similar experience for the Form and Data table controls. If they add a Display or Edit Form control, and connect it to the Case entity, they will see an ordered list of data cards for some fields that are automatically added for them.

Intelligent initial selection of fields for the Form control

To learn more about form layout, please read: Understand data form layout in Microsoft PowerApps.

For a Data table control, app authors will see that the columns are automatically added for some fields.

Intelligent initial selection of fields for the Data table control

To learn more about the Data table control, please read: Data table control in PowerApps.

The Common Data Service provides this ordered list of fields based on the field groups that are defined on entities. In the preceding example, the Gallery control gets its ordered list of fields from the DefaultCard field group of the Case entity. The Display and Edit Form controls get their ordered list of fields from the DefaultDetails field group of the Case entity. The Data table control gets its ordered list of fields from the DefaultList field group of the Case entity. To take advantage of this feature for a custom entity, app authors should add the appropriate fields to these same field groups for their custom entity. This will enable the same great behavior in the PowerApps controls when used with that custom entity.

It’s important to note that even though the controls (Gallery, Form, and Data table) use the fields from the field group, there is no on-going dependency between the controls and the field groups. The controls rely on the ordered list of fields that the connector provides to them. The connector (the Common Data Service connector in this case) just happens to use the field groups to provide that ordered list of fields. The controls themselves are not aware of the existence of field groups. Additionally once the initial field selection is done any changes to the field group do not automatically propagate to the controls.

Great news! This feature isn’t limited to Common Data Service. Any PowerApps connector can provide an ordered list of fields that the controls look for. To create the ordered list, a connector can use its own internal concepts and logic.

Currently, only the Common Data Service connector provides the ordered list of fields but we hope that in the future more connectors will light up this feature.

We're just getting started with this feature, so there are a few known issues that we are working to quickly fix in subsequent releases. Here are some of these issues:

  1. Some field types, such as lookups, are currently skipped when fields are connected to child controls.
  2. Intelligent initial selection isn’t used for Gallery controls when an app is created from data for a Common Data Service entity.

Prepopulated gallery layouts

Standard layouts and intelligent initial selection of fields help app authors get a jump start to create forms for their business apps. However, customizing galleries to make them business-ready often takes more time and effort. To help reduce authoring time, we now provide rich prepopulated gallery layouts for some of our most frequently used Common Data Service entities!

Follow these steps to understand how you can add them in your app.

  1. Create a blank tablet or phone app.
  2. On the Insert tab, click or tap Gallery, and then click or tap Vertical.
    A Gallery control is added to the screen. By default, the layout is set to Image, title and subtitle.
  3. In the right pane, click or tap CustomGallerySample, and then click or tap Add a data source.
  4. In the list of connections, click or tap the connection for your database.
  5. In the list of entities, click or tap Worker, and then click or tap Connect.
  6. A data source for the Worker entity is created, and the DataSource property of the gallery is set to that data source.
  7. In the layout picker, click or tap Image, title and subtitle, and then, in the Prepopulated section, click or tap Worker list.
    The Gallery control is updated to a rich prepopulated layout for the Worker entity.

 Prepopulated gallery for Worker

These prepopulated layouts are authored by the Common Data Service team. Their design incorporates the team’s knowledge of the entity’s metadata and fields.

As of today, prepopulated gallery layouts are available for the following Common Data Service entities.

  • Alumnus
  • Application user
  • Contact
  • Person
  • Worker

Prepopulated gallery layouts will be made available soon for these other Common Data Service entities.

  • Account
  • Case
  • Organization
  • Product
  • Purchase order
  • Sales invoice
  • Sales order
  • Vendor

Based on your feedback and usage, we hope to add more in the future!

When app authors use a prepopulated layout in their app, they get a copy that is independent of the original layout. Any changes that they make are saved in their app and don’t affect the original layout definition. Similarly, changes that the Common Data Service team publishes to the layout definition won’t be automatically reflected in their app.

To learn more about the Gallery control and how to customize it, please read: Gallery control in PowerApps and Show a list of items in PowerApps.

We also plan to extend the concept of prepopulated layouts to the Form and Data table controls in a future release. We will investigate this option, based on the feedback that we receive from you.

Just like the intelligent initial selection of fields feature that was described above, the prepopulated layout feature isn’t limited to just the Common Data Service. Any PowerApps connector can provide prepopulated layouts for its data sources.

We hope that these features will help app authors quickly create great apps and deliver rich end-user experiences with less effort. As always, we look forward to receiving your feedback and hearing about your experience with these features.

Thanks!
Anees