In the beginning life was good with Power Automate and Multi-select Option Sets. The Dynamics 365 Connector Trigger returned the option set values in the body, as you can see below. However, the D365 connector came with a lot of it’s own limitations and inefficiencies. The Microsoft Power Automate product team replaced it with the CDS Connector and then eventually the CDS new environment connector.
For example one of the limitations the CDS connector(s) fixed was support for only triggering based on changes to fields you would specify in the trigger itself.
However, one of several things that got left out (and hopefully will be filled soon) is that the CDS triggers did not return the multi-select option sets values in the their body. Therefore it is now impossible to configure the trigger to only listen to multi-select option set changes.
As a work around it is necessary to use the Get Record action to retrieve the multi-select option set values, use it in a condition check comparison to the one you are ‘looking for’ that you put into a variable. This means that if your business logic is looking for a particular option value it will have to fire every time the record is created or updated and then determine if it should have fired and if so continue.
The following is a high level design pattern for applying the necessary flow action card logic.
Step 1 – CDS Trigger
Start with the CDS trigger for either Create or Update or both.
Step 2 – Initialize Variable
Use this step to set/initialize the variable that we will use in the condition check later. Set the value to the option set value you are seeking to take action on. By the way, don’t try to use the Compose action, it doesn’t work. You will get a type mismatch error later when doing the comparison.
Step 3 – Condition Check
For the Condition check put the Contact Type dynamic field from the Get record step in the first part of the check. Then set the comparison to ‘contains’. In the right hand side that is where you use the dynamic content from the Initialize Variable step.
If the record you triggered on has the option set value in it, it will evaluate as true, if not false.
So this isn’t like any super advanced citizen developer stuff, but I hope that it saves you a few minutes when you go to figure out how to work with multi-select option sets.
And we all hope that within a few months from now we won’t have to do this as the product team will have built into the CDS trigger the retrieval of the option set values in the Output body of the CDS new environment trigger along with supporting it in the filtering.