Wednesday 30 December 2020

HOW TO APPEND MULTI SELECT OPTION SET IN DYNAMICS 365 USING MICROSOFT FLOW

Multi Select Option Sets were introduced in version 9.0 of Microsoft Dynamics 365 CRM. D365CE Multi Select Option Sets are a great new capability. The way to apply business rule functions to a Multi Select field is to use JavaScript.

Multiselect Option Sets are also limited in the case of Workflows. We can not select these fields in a condition nor modified in an update record step. The field will not even appear on the update record form. However, the field can still be selected as a trigger for the workflow.

If we want to append Multiselect option set values, we can use Microsoft flow.

NAVIGATION STEPS:

Step 1: Sign in to Power Automate.

Step 2: Choose the Environment where we need to create a flow.

MULTI SELECT OPTION SET_1

3rd Step: Select My flows from the navigation bar.

MULTI SELECT OPTION SET_2

Step 4: Click on New to create a flow.

MULTI SELECT OPTION SET_3

5th Step: Specify a Name for the flow and then choose the trigger point when flow need to be started.

MULTI SELECT OPTION SET_4

SCENARIO:

Let assume that, we are having two entities Contact (Parent) and Campaigns (Child) with 1: N relationship between them.

We have two fields called Policy Interest_Campaign and Regional Interest_Campaign. Field type is Multi select option set in Campaigns entity.

We have two fields called Policy Interest_Contact and Regional Interest_Contact.  Both are of type Multi select option set in Contact entity.

However in this scenario, if the Policy Interest_Campaign and Regional Interest_Campaign contain value then append it to Policy Interest_Contact and Regional Interest_Contact.

Step 6: Choose the Trigger condition from the options and choose the entity as Campaigns.

MULTI SELECT OPTION SET_5

7th Step: Get the records from the Campaigns.

Step 8: Get the records from the Contacts.

MULTI SELECT OPTION SET_6

9th Step: Initialize two variables for Campaigns.

MULTI SELECT OPTION SET_7

Step 10: Initialize two variables for Contacts.

MULTI SELECT OPTION SET_8

11th Step: Check condition for Policy Interests/Regional Interests is not equal to Null, which are in the Campaign record.

MULTI SELECT OPTION SET_9

Step 12: Fetch records of contacts associated with the selected Campaign.

Step 13: Check condition for Policy Interest is equal to Null, which is in the Contact record.

MULTI SELECT OPTION SET_10

14th Step: If yes, append the values from Policy_Interest_Campaign  to Policy_Interest_Contact.

In Append to String Variable Action. In the place of Name, choose the variable Policy_Interest_Contact and Value as which values. We need to append (Policy_Interest_Campaign field in Campaign entity).

Step 15: Update the Contact record. Choose the item ID value and the field (Policy Interests) which we need to update.

MULTI SELECT OPTION SET_11

MULTI SELECT OPTION SET_12

Step 16: If Policy_Interest_Contact contains values. In Append to String Variable, In the place of Name choose the variable Policy_Interest_Contact.

Multiselect option values appended using “,” (comma). In the Value as which values, we want to append (,) (Policy_Interest_Casmpaign field in Campaign entity).

Step 17: At the end update the Contact record. Choose the item ID value and the field (Policy Interests) which we need to update.

MULTI SELECT OPTION SET_13

MULTI SELECT OPTION SET_14

18th Step: Repeat Step 13 to Step 17 for Regional Interest.

MULTI SELECT OPTION SET_15

Resource: https://www.adyatantech.com/blogs/how-to-append-multi-select-option-set-in-dynamics-365-using-microsoft-flow

No comments:

Post a Comment

Open HTML Page from Button with Ribbon Workbench

There may be a requirement to open an HTML page from a button. In this example, we will use the Ribbon Workbench to open a page from a butto...