Site name
Automation

Power Apps to Dataverse: Saving multi-select choices correctly

PMTheTechGuy
··3 min read
Power Apps to Dataverse: Saving multi-select choices correctly cover image

If you're coming from SharePoint, you might think saving a list of choices to a column is as simple as sending a comma-separated string. In Dataverse, it's a completely different game.

Multi-select Choice columns in Dataverse (formerly "Multi-select Option Sets") are incredibly powerful for reporting and filtering. But because Dataverse stores these as a collection of integers rather than just text, the implementation logic in Power Apps can be tricky.

In this "Level-Up" guide, we'll look at the right way to handle these columns using the Choices() function and the Patch() command.


1. Why Dataverse is different

In SharePoint, a multi-select column is essentially a messy string under the hood. In Dataverse, it is a formal Choice Set. Every text label (e.g., "Red", "Blue") has a corresponding numerical value (e.g., 10000001, 10000002).

When you try to save data from a Power Apps Combo box into Dataverse, the database isn't looking for the words "Red" and "Blue"—it's looking for those specific integers.


2. The Combo Box Setup

The most common way to collect multi-select data is the Combo Box control.

To ensure your app stays in sync with your database, never hard-code the items in your combo box. Instead, use the Choices() function in the Items property:

Choices([@'YourTable'].YourMultiSelectColumn)

By doing this, Power Apps automatically pulls the latest labels and underlying values directly from Dataverse.


3. Saving the Data: The Patch() Command

When you're ready to save the selected items, you need to pass the entire selected collection from the combo box.

If you are using a Form control, Power Apps handles this for you. But for professional apps that require more control, you'll likely be using Patch().

The Correct Syntax

Patch(
    'YourTable',
    Defaults('YourTable'),
    {
        Title: "New Record",
        YourMultiSelectColumn: ComboBox_Tags.SelectedItems
    }
)

Crucial Tip: Because you used the Choices() function in the Items property of the combo box, the SelectedItems property already contains the exact record structure (Labels and Values) that Dataverse expects.


4. Common Pitfalls

Pitfall A: The "Direct Text" error

You cannot use Concat() to join the values into a string and save that. Dataverse will reject it with a type mismatch error.

  • Wrong: YourColumn: Concat(ComboBox.SelectedItems, Value, ",")
  • Right: YourColumn: ComboBox.SelectedItems

Pitfall B: Default Selected Items

When editing an existing record, your combo box might look empty even if data exists in Dataverse. You must set the DefaultSelectedItems property of the combo box to:

ThisItem.YourMultiSelectColumn

Just because you can use multi-select doesn't always mean you should.

  • Use Multi-Select Choice: When you have a fixed, small list of options (e.g., "Days of the week" or "Department Status") that won't change often.
  • Use a Related Table (N:N Relationship): When you have a large or dynamic list (e.g., "Project Team Members" or "Product Categories") that needs its own metadata or needs to be searchable independently.

Summary

Dataverse multi-select columns require a bit more discipline than SharePoint, but they provide much better data integrity.

  1. Use Choices() for your Items.
  2. Pass the whole SelectedItems to your Patch.
  3. Avoid Concat() for storage.

Mastering these small details is what separates a Power Platform amateur from a professional developer. Keep building!

Tags

#Power Apps#Dataverse#Dynamics 365#Development
Newsletter

Stay updated with my latest projects

Get notified when I publish new tutorials, tools, and automation workflows. No spam, unsubscribe anytime.

Follow Me

Share This Post

You might also like