Formmenu insert AND with the last choice

Hi all. I use this form, but for perfection touch, i search to insert the word "and" between the choices and the last choice.

{formmenu: default=choice1; choice2; choice3; choice4; choice5; name=choices; multiple=yes}

For exemple :
Choice1, choice2 and choice5.

Big thanks for help :slight_smile:

hey @Frenchy_Devs -- someone else asked about exactly this yesterday. See post here:

All you need to do is add ; formatter=items -> join(items, "BLAZE_AND") to the end of your current formmenu, after multiple=yes and before the closing }

{formmenu: default=choice1; choice2; choice3; choice4; choice5; name=choices; multiple=yes; formatter=items -> join(items, "BLAZE_AND")}

Ha sorry. With my bad english, i see the post but impossible to apply for my uses. Very big thanks :slight_smile:

But i have {=choices} and here the result : ["choice1", "choice2", "choice5"]".

What can i do for remove [ " and replace the comma with the "or" word ?

Big thanks for this help

@Frenchy_Devs no worries, always happy to help.

The suggestion of using the formatter=... in my previous response changes the dropdown menu itself.

If you're re-stating the values of the dropdown menu elsewhere using a formula, like you are with {=choices}, then you need to use that "join" function again.

Below are two examples of how you can do that. I'm not sure which one you wanted so I included both:

{choices=["choice1", "choice2", "choice5"]}
Separate every selection with "or": {=join(choices, " or ")}

Separate each selection with a comma except for the last one, which uses or: {=join(choices, "BLAZE_OR")}

In case you want to learn more, when a dropdown menu has multiple=yes, it saves the selections as a list. Here's a guide that details exactly how to turn that list back into a string like I'm doing with the join function above.


The second way is perfect for me. And work great.

Big thanks :slight_smile: