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.
Here’s what you need to do:
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.
Add the required html references to web pages.
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.
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).
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.
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.