Add Comma and 'and' to enumeration

Hi,

Hi is there a way to get the following result in regards of comma and 'and'?

Example 1:

Option A
Option B
Option C

You chose A, B and C.

Example 2:
Option A
Option B [ ]
Option C

You chose A and C.

Hi,

You can achieve this using the "formatter" setting in dropdown menus with functions from the formula reference. I have attached a snippet below that does this:

{formmenu: red; green; blue; yellow; multiple=yes; name=items; formatter=(items) -> join(slice(items, 1, count(items) - 1), ", ") & ", and " & items[count(items)] if count(items) > 2 else join(items, " and ")}

Best regards,
Alexander

Amazing. Thank you!