Share via

Choices (multi-select option set) Power Apps component framework sample

This sample demonstrates how to leverage the multi-select option set type on properties of field components. By binding the code component's primary property to this type, users can create all new types of controls with a choices column.

Preview of the sample

Compatibility

This sample works for model-driven apps.

Applies to

Power Apps component framework

Get your own free development tenant by subscribing to Power Apps Developer Plan.

Contributors

This sample was created by the Power Apps component framework team.

Version history

Version Date Comments
1.0 January 18, 2024 README created

Prerequisites

Install the Microsoft Power Platform CLI

Try this sample

Follow the steps in the README.md to generate solutions containing the controls so you can import and try the sample components in your model-driven or canvas app.

Note

When you run this sample using the test harness, you get the following error:

 Error occured during initilization of control: SampleNamespace.MultiSelectOptionSetControl;Message: Cannot read properties of undefined (reading 'forEach')
 TypeError: Cannot read properties of undefined (reading 'forEach') at multiSelectOptionSetControl.init

The option set control data can't be simulated or mocked in the test harness. This sample only runs correctly when you configure it for a field in a model-driven app.

Implementing choices (multi select option set) component.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.