Dynamics 365 Option Set Generator
Turn a list of choice labels into a C# enum, TypeScript enum, JavaScript constants or JSON.
Runs in your browser. Nothing you enter is uploaded.
C# enum
Enter your option labels to generate code.
About Dynamics 365 Option Set Generator
Dynamics 365 Option Set Generator saves you from typing enums by hand. Paste the labels of a choice column, and it numbers them from your publisher's value prefix and generates code you can copy into plug-ins, form scripts or integrations.
Labels are turned into safe member names automatically, and duplicates are caught before they become bugs. Check generated values against your column if it already exists, because its values may differ. This is an independent tool, and is not affiliated with or endorsed by Microsoft.
How to use Dynamics 365 Option Set Generator
- 01Enter your labels, one per line, with values if you already have them.
- 02Set the enum name, and a starting value that matches your publisher.
- 03Copy the code in the language you need.
Features
- C# enums, TypeScript enums, JavaScript constants and JSON
- Automatic numbering from a starting value
- Accepts formats such as "Label, 100", "Label = 100" and "100, Label"
- Safe, unique member names from any label
- Catches duplicate and out-of-range values
Frequently asked questions
- What starting value should I use?
- Dataverse numbers new choices from your publisher's option value prefix, so the values are often 100000000, 100000001 and so on for the default publisher. Use your own publisher's prefix to match.
- What is the difference between an option set and a choice?
- They are the same thing. Dynamics 365 called them option sets, and newer Dataverse and Power Apps documentation usually calls them choices.
- Why was my label changed in the code?
- Code names cannot contain spaces or most symbols, so a label like In Progress becomes InProgress. The original label is kept in the JSON output.
- Is my list sent anywhere?
- No. It runs entirely in your browser, and nothing you enter or open is uploaded, stored or sent to a server.