Option sets: reusable choice lists, with colours and icons
An option set is a list of choices you define once and use on any table. Each option can have a colour and an icon, and gets a number from your publisher's range that never changes, so renaming is safe and two publishers' lists never collide.

A course is taught in person, online, or both. An order is draft, sent or paid. When the answer comes from a short list that you decide, not from another table, use an option set. It's a list of choices you define once and then use on as many tables as need it.
Every field type, explained used one already: Course level, behind the Level field. Here we build a new one, Delivery mode, and put it on two tables. Every picture is the real product.
Create the set
Open your solution, choose Option Sets in its rail, then New. Give the set a display name
(Delivery mode) and a logical name. The publisher's prefix, con_ here, is added for you. Then add
the options, one row each:

Each row has four parts:
- The label, which is what people see and pick.
- A colour (the square) and an icon (the button beside it). Both are optional.
- The value, a number the platform assigns when you save. A new row says Assigned on save until then.
- The grip on the left. Drag it to change the order people see. Moving an option never changes its value.
The colour square opens twelve quick colours, and a picker for any other colour, with a box for a hex code:
The icon button opens a searchable list of icons. Type clock and pick one. Clear colour and Clear icon are inside their pickers.
Colours and icons don't change any data. A record stores the option's value, so you can recolour an option at any time and nothing that uses it breaks.
Use it on any table
A field uses the set when its Data type is Option set. Choose the set, and that's all. Here the same Delivery mode set goes on a second table, so a contact can have a Preferred delivery:
The course has its own Delivery field on the same set. Both fields now offer the same four choices. When you add a fifth option to the set, both get it. There is one list to maintain, not one per table.
A new field isn't placed on existing forms automatically. Drag it onto the form in the form designer, then save the form.
On the form
On the form, the field is a dropdown. Each option shows its icon, and both the icon and the label take the option's colour:

The chosen value keeps its colour and icon once the list closes, so Hybrid stays purple on the form. Level above it is coloured in the same way by its own set. A list of statuses reads at a glance this way: Overdue in red among a hundred others stands out without being read.
The numbers behind the labels
What a record stores is the option's value, not its label. That's why:
- Renaming is safe. Correct Online to Remote and every course that said Online now says Remote. They all held 270160001, and still do.
- You never type a value. The platform assigns it and never changes it. You can see it, which matters if another system reads your data.
- Removing an option that records use is refused. Change those records to another option first. Otherwise they would hold a number that means nothing.
The values are large because they come from a range that belongs to your publisher. Each publisher has its own option value base, on the Publishers page:

Contoso's sets count up from 270160000. If every publisher counted from zero, importing two publishers' solutions into one environment could make one publisher's Draft the same number as another's Cancelled. Separate ranges rule that out.
When it moves between environments
An option set is part of your solution, like the tables that use it. Export the solution and the set goes with it, with its values, colours and icons. In Test and Production, 270160001 still means Online. On import, the set arrives before the tables whose fields use it, so a field is never left pointing at a set that isn't there.
Importing a newer version of the set updates the one that's already there. Labels are refreshed and new options added. An option that records still use isn't deleted out from under them.
The set as the solution stores it
An option set is a small document of its own, separate from the tables that use it. Delivery mode after the steps above:
{
"logicalName": "con_deliverymode",
"displayName": "Delivery mode",
"publisherPrefix": "con",
"description": "How a course is taught.",
"optionValueBase": 270160000,
"nextOptionValue": 270160004,
"options": [
{ "value": 270160000, "displayName": "In person", "color": "#16a34a", "icon": "Users" },
{ "value": 270160001, "displayName": "Online", "color": "#2563eb", "icon": "Monitor" },
{ "value": 270160002, "displayName": "Hybrid", "color": "#9333ea", "icon": "Shuffle" },
{ "value": 270160003, "displayName": "Self-paced", "color": "#f59e0b", "icon": "Clock" }
]
}
Two lines are worth a look.
nextOptionValueis the number the next new option will get. It only ever goes up. Delete Self-paced and add Blended, and Blended gets 270160004, never 270160003 again. A number that once meant Self-paced can't come back meaning something else, which matters to any report or integration that kept old values.- The order of
optionsis the order people see. That is all dragging the grip changes.
A field that uses the set says so by name, "optionSet": "con_deliverymode", so the set and the
field can change separately: recolour an option and no table needs touching.
In a view, and in a filter
The colours aren't only for forms. A view column for an option set shows each value in its colour, with its icon, exactly as the form does. A list of two hundred courses with Online in blue and In person in green can be read down the column without reading a word.
A filter on an option set lets you pick from the set's own labels, and is one of takes several at once: Delivery is one of Online, Hybrid finds every course somebody can join from home. Because the filter stores values rather than labels, renaming Online to Remote doesn't break it.
Views: the lists people work in and Filters with And and Or go further.
In a script
To a script, an option set field's value is its number. A rule that reacts to the delivery mode compares numbers, and a comment saying which option each is saves the next reader a trip to the set:
// 270160001 is Online in the Delivery mode set.
var online = getValue('con_delivery') == 270160001;
setVisible('con_meetinglink', online);
setRequired('con_meetinglink', online);
Comparing the number rather than the label is what keeps the rule working when somebody renames an option or switches the app to Persian, where the label reads differently but the number is the same. If several rules need the same number, keep it in one solution script so it is written down once.
In a report and through the API
A report prints the option's label and can group by it: one section per delivery mode, with a count under each. The record API gives the number, because a system reading your data needs something that never changes. If an integration needs the labels as well, it can read the option set once and keep the list, since a value never changes its meaning.
One choice per field
An option set field holds one value. If a course can be both Online and Self-paced, that is two facts, and it needs either two yes/no fields or a separate table. The test is the same as for a lookup: if the answer is several of these, make a table with one row per answer.
States and reasons are related but different. Every table has a State and a Reason already, built in, with their own options. Use them for where a record is in its life, and an option set for everything else you want to classify.
Good habits with option sets
- Name the set for what it describes, not the table that uses it first. Delivery mode can go on courses, contacts and events; Course delivery sounds as if it can't.
- Keep labels short. They appear in narrow view columns and on phone screens. Hybrid reads better than Partly in person, partly online.
- Use colour for meaning. Red for Overdue and green for Paid help; a different colour for each of nine departments mostly doesn't. Leave the colour empty where it adds nothing.
- Add an option rather than reuse one. If Hybrid starts meaning two things, add a second option and move the records across, rather than changing what the old one means.
- Write the description. It appears in the designer for the next maker, and explains when to use the set.
Questions that come up
Can two option sets share a value? Within one publisher, no: each set counts up from the publisher's base, and the platform assigns the numbers. Between publishers the ranges are separate, which is the point of having them.
Can I import records that give the label instead of the number? The spreadsheet import matches an option set column by its label, so a CSV can say Online rather than 270160001. Import records from a spreadsheet shows the matching.
What happens to the field if I delete the whole set? A set that a field still uses can't be deleted. Remove or change the fields first, then the set. This is the same rule that stops a record being deleted while something points at it.
Can each table have its own version of the set? No, and that is what makes it reusable. If two tables need different lists, make two sets. Use one set only where the meaning really is the same, so that a filter or a report across both tables compares like with like.
Option set, lookup, or text?
| The values are… | Use |
|---|---|
| A short list you decide, changed when the app changes | Option set |
| Records that people add, such as customers, rooms or products | Lookup to a table |
| Anything anyone might type | Text |
If users will need to add a choice themselves, it belongs in a table with a lookup, not in an option set.
Next: states and reasons, the active and inactive lifecycle every table has, and why a record moves between them.