Tip #870: How to set an optionset value in the workflow

Sometimes Dynamics 365 plays a cruel déjà vu game.

I swear I was able to do that just last week

and Dynamics 365 like:

Since version Dynamics 365 Online refuses to allow setting up or clearing optionset values in the workflow editor. Yes, you can set it to a fixed value but not to a value from another compatible optionset. In fact, it’s not possible to select an optionset field at all. Note that existing workflows are not affected until you remove the value (crafted previously) from the optionset.

The team is aware of the problem and fix is in the pipeline. Until the fix arrives, the workaround is quite straightforward:

  • Create blank solution; create a publisher in the process if you don’t have one (why not?).
  • Add the workflow you need to fix to this solution. Keep it draft, no need to activate. If you use custom entities or attributes, add those too.
  • Export the solution. No need to publish anything. You may need to use 8.1 or earlier version during the export (see next step).
  • Import solution to either Dynamics 365 On-premises or to an online organization Dynamics CRM 2016 Update 1 or earlier (use sandbox reset feature to get specific version going).
  • Set your optionsets as you see fit.
    Optionset in workflow
  • Save the workflow, export the solution, import it back to Dynamics 365 Online.

Optionsets should be good now (but don’t touch them!).

23 thoughts on “Tip #870: How to set an optionset value in the workflow

  1. Eric L says:

    This just happen to me yesterday. I thought I was going crazy. As I was sure I was able to do this in the past. My workaround was to manually modify the solution file. (NOTE: XML is hard XAML is harder)

    • You are a brave man, Eric. I checked the xml required to add an optionset and decided against showing it here. It’d be so easy to screw it up…

    • Ionut S says:

      Hi Eric,
      may you please post an example on how you modified the solution.xml file?
      I’ve tried that myself, but couldn’t find any specific mapping between the fields from one entity to another.
      Thank you

    • Augusto says:

      Hey guys.. i did the same thing.. it’s not that hard.
      The best way to achieve it editing the XAML is setting in other text field, the value of the optionset. so it’s just a matter of copy and paste (with caution lol)

  2. John Clark says:

    I came across this a few weeks ago with a couple of clients. The first time was when I had to change some workflows as part of a weekend upgrade to Dynamics 365. We’d tested the upgrade of the customisations in an on-premises dev server, including the workflow change. In the end I turned on the dev server and exported the workflows from there.

    This is not the only solution/customisation issue that I’ve come across since the upgrade to Dynamics 365.

  3. Steve Mordue says:

    Well this just added a bunch of unnecessary hours to something simple, that should just work! Any indication of time frame for MS fix?

  4. Sumedha says:

    This put me to utter frustration.. thanks for the post..

  5. Scott Martin says:

    We tried the workaround but got the following when exporting to 8.0 or 8.1 versions:
    The Workflow XYZ hasn’t been added to the solution because it contains at least one Attribute that won’t work in earlier versions of CRM.

  6. The patch goes in tonight at EOD.

  7. And fixed:

    • Michael says:

      Tonight you say..
      This is driving me F*in crazy, how many times do we have to go through this ? I want to scream into the night. Microsoft, please call, I can help you or show you how to regression test, no charge on my dime, it would be my pleasure.

      For online, is this a hot fix that MS will apply tonight ??

      • Dave Harris says:

        I really need this fix too otherwise I need to write a really contrived workflow as a workaround.

        • Dave Harris says:

          This is on D365 online. Do MS patch all of their systems at the same time or does it take a little while. Can we request it to be patched? Thanks

    • Sergio Nuzzi says:

      Hi Micheal,

      You mentioned that it was fixed in… online or on-premise?

      Sergio Nuzzi

    • Sergio Nuzzi says:

      Hi Micheal,

      You mentioned that your problem was fixed in Was this online or on-premises?



  8. Bernard Vixseboxse says:

    The problem is still there in 9.0, at least for clearing Option Set values. The workaround mentioned here does not work anymore since there is no possibility to export to an earlier version from 9.0….

  9. Georgii Smirnov says:

    The problem is fixed in v9. Working as expected in

  10. Ben says:

    This is occurring for me in v9.1.0.1450.

    Very frustrating! It seems MS fix it then break it again with a new version.

Leave a Reply

Your email address will not be published. Required fields are marked *