How to Set Up Multi-Select Option in Power Apps Portal

With the release of Dynamics 365 v9.0, Microsoft introduced a new data type – Multi-Select Option Set. With the help of this new data type, we can select more than one option set in Dynamics 365.

The Power Apps Portal/Dynamics Portal does not support multi-select option field types out-of-the-box on Entity Forms and Web Forms. The work around is to create a dummy multi-select option set field in Entity Forms and Web Forms at whichever places you want to use. With some amount coding, you can demonstrate a particular pattern that can be used to add sophisticated UI elements to your Portal.

In this blog we will show how to display Multi-Select Option Set Field on Portal Apps and how to set Multi-Select Option Set value in Microsoft Dynamics CRM from Portal.

How to Display Multi Select Option Set Field in Power Apps Portal:

Step 1:

Here’s what you need to do:

  1. Create a text-field in CRM for portal internal use.
  2. Add that created field into entity form and hide that field on entity form.

Now comes the actual programming part. By using the below code, we can create a dummy multi-select option set in portal by using the same option values of original multi-select option field.

Step 2:

Add the required html references to web pages.

Step 3:

Below is the sample code to create a multi-select option set field in portal.

Change the IDs of fields as per the fields you are using.

Step 4:

After successfully executing the above steps, you should see the output as displayed below. The output will display below the text field that you had created earlier in the CRM (refer Step 1).

Step 5:

Write the code to add the selected options to hidden text field as shown below. Using those values (each option contains separate value, if not, it means you have to add a value to each option when you are creating options) you should update the field in CRM as well.

How to Update Selected Values in CRM:

Step 1: On Create this record (Ex: I’m using this multi-select option set on contact form, so when I’m creating or updating contact record) trigger a Microsoft flow.

Step 2: Get the values of the hidden textbox and check in the Microsoft flow the selected option values are retrieved or not.

Step 3: After step 1, if values are retrieved means, update the record and set the retrieved values to the original multi-select option set field in the Microsoft flow.

Step 4: Run the flow and check the output. The values will set in multi-select option set field in Microsoft CRM as shown below.

We hope this was useful. Learn more about Multi-select in Portals here.